Here is my line of code:
Can't see why this would need debugging?![]()
Set totalrng = Worksheets("DO RSH and RSM").Range("B6", Range("P" & Rows.Count).End(xlUp))
Here is my line of code:
Can't see why this would need debugging?![]()
Set totalrng = Worksheets("DO RSH and RSM").Range("B6", Range("P" & Rows.Count).End(xlUp))
What error message are you getting.
Are you able to upload the workbook so that we can see the problem in context?
Richard Buttrey
RIP - d. 06/10/2022
If any of the responses have helped then please consider rating them by clicking the small star iconbelow the post.
There's no worksheet reference for the Rangem inside the brackets.
Try this.
![]()
With Worksheets("DO RSH and RSM") Set totalrng =.Range("B6", .Range("P" & Rows.Count).End(xlUp)) End With
If posting code please use code tags, see here.
This is still returning an error. Here's my workbook:RPI_Sheet_NEWregrange.xls![]()
With Worksheets("DO RSH and RSM") Set totalrng = .Range("B6", Range("P" & Rows.Count).End(xlUp)) End With
That isn't the code I posted.
I left out a decimal point... *facepalm* Thanks for keeping me in line, Norie!
Hi,
I still can't see why your original code didn't work unless it was inside a WITH statement which wasn't mentioned in your original.
It worked OK for me as a straightforward line of code on its own so I'm still intrigued as to the error you were getting.
Richard
The code would fail if any worksheet other than 'DO RSH and RSM' was active.
The reason for that is that Range("P" & Rows.Count).End(xlUp) refers to the active sheet.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks