Вот функции, которые я использую:
Public Function FindLastColumnInWSheet(ws As Worksheet) As Long
Dim LastCol As Long
Dim rng As Range
Set rng = ws.Cells.Find(What:="*", _
After:=ws.Range("A1"), _
Lookat:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious, _
MatchCase:=False)
If rng Is Nothing Then
LastCol = 1
Else
LastCol = rng.column
End If
FindLastColumnInWSheet = LastCol
End Function
Public Function FindLastRowInColumn(wsheet As Worksheet, columnName As String) As Integer
With wsheet
FindLastRowInColumn = .Range(columnName & .rows.Count).End(xlUp).row
End With
End Function