Glory
Well-known Member
- Joined
- Mar 16, 2011
- Messages
- 640
Code:
Set c = ThisWorkbook.Sheets("List")
d = c.Range("D" & Range("D" & Rows.Count).End(xlUp).Row).Row
If d < 2 Then d = 2
Set g = ThisWorkbook.Sheets("Sum")
h = g.Range("A" & Range("A" & Rows.Count).End(xlUp).Row).Row
[FONT=Times New Roman] MsgBox “Sheet name = ” & g.Name & “, “ & “Last Row = “ & h[/FONT]
This code is not working properly.
This should return the last blank row in column A of sheet "Sum".
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o> </o>
Instead, it’s returning the last blank row in column A of the active sheet.
I know this because I've changed the active sheet a bunch of times. Every time I do, the code spits out the last row of the active sheet, while "g.Name" returns the name of sheet "Sum".
Any ideas about this weird issue?