Try this Function to get the next available row for data entry on any sheet.
Sub test()
Dim lr As Long
' Call NextAvailableRow for any Worksheet that you are looking for the next available row.
' First param is WhatSheet = Worksheet Name as string
' Second param is WhatColumn = Column as string
lr = NextAvailableRow("WorksheetName", "C")
' Do something now we lastrow
Worksheets("WorksheetName").Range("A" & lr) = ""
End Sub
Function NextAvailableRow(WhatSheet As String, WhatColumn As String) As Long
If Application.Version <= 11 Then
NextAvailableRow = Worksheets(WhatSheet).Cells(Rows.Count, WhatColumn).End(xlUp).Row + 1
Else
NextAvailableRow = Worksheets(WhatSheet).Cells(Rows.CountLarge, WhatColumn).End(xlUp).Row + 1
End If
End Function
Bookmarks