Hi, PW11,
try either
or![]()
With Sheet2 Set rMonthRng = .Range("J2", .Range("J" & Rows.Count).End(xlUp)).Offset(0, 1) End With
Ciao,![]()
With Sheet2 Set rMonthRng = .Range("J2", .Range("J" & Rows.Count).End(xlUp).Offset(0, 1)) End With
Holger
Hi, PW11,
try either
or![]()
With Sheet2 Set rMonthRng = .Range("J2", .Range("J" & Rows.Count).End(xlUp)).Offset(0, 1) End With
Ciao,![]()
With Sheet2 Set rMonthRng = .Range("J2", .Range("J" & Rows.Count).End(xlUp).Offset(0, 1)) End With
Holger
Use Code-Tags for showing your code: [code] Your Code here [/code]
Please mark your question Solved if there has been offered a solution that works fine for you
Hi Holger,
Thanks for the quick response -
Your options worked perfectly.
I have incorporated your suggestion, but for my own understanding - are you able to tell me why my code does not work?
I have used it before and have not had a problem so am totally stumped as to why it wouldn't work.
Many thanks!
Hi, PW11,
This part is related to the sheet with the codename Sheet2 while![]()
Sheet2.Range("J2",
relates to the ActiveSheet. As long as ActiveSheet is Sheet2 there should be no problem, otherwise the range object would require you to build two areas of this range: one on the ActiveSheet, one on Sheet2.![]()
Range("J65536").End(xlUp)
HTH,
Holger
Hi Holger,
Excellent!
Thanks very much for this - explains perfectly why it was working in one context, but not here (the code was being run from the active sheet in my original example, but not in this one).
Very much appreciate the education!
Kindest Regards
PW11
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks