Hi folks, I am stuck right at the beginning of a code I am trying to write. I am attempting to write a VBA code that finds the last used row in column A, and saves the address as a variable. So if for example the last row was row 10, then the variable would use "A10". What I have so far is:
This code only returns the row number. I can see why that is the case, but can't figure out how to change it. The msgbox is just in the code for now to see if I am getting the code right (which I am not!)
What I finally want to do is put the finished code in the worksheet as a private sub to run whenever the list in column A grows (the list in Column A is not edited directly but pulls information when another sheet is populated). I'm not even going to think about this second part yet!
Hope someone can help
Code:
Sub find_last_row_of_data()
Dim LR As Long
With ActiveSheet.Cells
LR = .Columns(1).Find("*", .Cells(1, 1), xlValues, xlPart, xlByRows, xlPrevious, False, False).Column & Row
End With
MsgBox "Last cell with data is " & LR, vbOKOnly, "REPORT"
What I finally want to do is put the finished code in the worksheet as a private sub to run whenever the list in column A grows (the list in Column A is not edited directly but pulls information when another sheet is populated). I'm not even going to think about this second part yet!
Hope someone can help