blackorchids2002
Board Regular
- Joined
- Dec 29, 2011
- Messages
- 138
Hello Masters,
I am having an error bellow when using a command button.
My starting point is in Sheet 2. I want to get the last row that has a record in Sheet 1 but it continue to read the last row in Sheet 2.
Sheet 1 is my raw data
Sheet 2 is my report and has list on it.
Private Sub CommandButton1_Click()
Dim Last_Row As Long
Dim mmraw As Worksheet
Set mmraw = Sheets("Excel Report")
mmraw.Select
mmraw.Cells(1, 1).Select
Set mmraw = ActiveSheet
With ActiveSheet
Last_Row = Cells(Rows.Count, 1).End(xlUp).Row
MsgBox Last_Row
End With
End Sub
Thanks
I am having an error bellow when using a command button.
My starting point is in Sheet 2. I want to get the last row that has a record in Sheet 1 but it continue to read the last row in Sheet 2.
Sheet 1 is my raw data
Sheet 2 is my report and has list on it.
Private Sub CommandButton1_Click()
Dim Last_Row As Long
Dim mmraw As Worksheet
Set mmraw = Sheets("Excel Report")
mmraw.Select
mmraw.Cells(1, 1).Select
Set mmraw = ActiveSheet
With ActiveSheet
Last_Row = Cells(Rows.Count, 1).End(xlUp).Row
MsgBox Last_Row
End With
End Sub
Thanks