This code finds the last used column in a specific row in the active worksheet.
VBA Code:
Sub FindLastColumn()
Dim lastColumn As Long
lastColumn = Cells(1, Columns.Count).End(xlToLeft).Column
MsgBox "Last Column: " & lastColumn
End Sub