Friday, April 08, 2005
Find the last filled column
Hello All,
I was searching for something else at MrExcel.com but found this interesting bit of code. This code will give you the last filled column in a Sheet.
I was searching for something else at MrExcel.com but found this interesting bit of code. This code will give you the last filled column in a Sheet.
Public Sub find_last_column()
'Found at MrExcel.com-solution given by Tom Urtis
Dim LC%
LC = Cells.Find(What:="*", After:=[A1], SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Column
MsgBox LC
End Sub
'Found at MrExcel.com-solution given by Tom Urtis
Dim LC%
LC = Cells.Find(What:="*", After:=[A1], SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Column
MsgBox LC
End Sub