poorwallace
Active Member
- Joined
- Mar 8, 2005
- Messages
- 365
Hi...here's what's going...
I'm working my way around to naming a range that I can work with...here's what I've got
When I step through the code, lastrow = 20, which is correct...so I figure lastrow52 will = Cell(18,5). Well...that's not what's happening. Lastrow52 is returning Cell(38701,5). I'm completely at a loss....any ideas?
Thanks
I'm working my way around to naming a range that I can work with...here's what I've got
Code:
Dim lastrow5 As Long
lastrow5 = Cells(Rows.Count, 5).End(xlUp).End(xlUp).Row
Dim lastrow52 As Long
lastrow52 = Cells(lastrow5, 5).Offset(-2, 0)
Cells(lastrow52, 5).Select
When I step through the code, lastrow = 20, which is correct...so I figure lastrow52 will = Cell(18,5). Well...that's not what's happening. Lastrow52 is returning Cell(38701,5). I'm completely at a loss....any ideas?
Thanks