I need to get the last column number on the second row, while the cited column is hidden.
The below code outputs wrong result if the last column is hidden.
Sub Last_column_number_even_is_hidden()
Dim ws As Worksheet, lastCol_n As Long
Set ws = ActiveSheet
lastCol_n = ws.Cells(2, ws.Columns.Count).End(xlToLeft).Column
MsgBox ("Last column number is " & lastCol_n)
End Sub