There is no dumb questions, only dumb people asking questions. I might fall in that category right now.
I want to achieve the following :
Sub test
Dim lastcolumn as long
lastcolumn = Range("A1").End(xlToRight).Column
DebugPrint lastcolumn '=5
'Add 2 columns between first and last col
DebugPrint lastcolumn '=7
End Sub
right now I need to do as follow :
Sub test
Dim lastcolumn as long
lastcolumn = Range("A1").End(xlToRight).Column
DebugPrint lastcolumn '=5
'Add 2 columns between first and last col
lastcolumn = Range("A1").End(xlToRight).Column
DebugPrint lastcolumn '=7
End Sub
So I end up with
lastcolumn = Range("A1").End(xlToRight).Column
all over the place
What's the correct way to do that?
lastcolumn = Cells(1, Columns.Count).End(xlToLeft).Column- urdearboylastColumnstores the column number but is not updated when the sheet changes... - BigBen