rhommet
rhommet

Reputation: 13

Why does range(..).End() do not work in an inactive sheet?

I'm trying to declare all the ranges I'll be using in the rest of my code. It works fine when the range is in the same sheet as the button which calls the macro. When it is a simple range in an other sheet, it works as well but when I'm trying a range with end() it does not work in the other sheet.

Sheets("Current").Range("A1:B3") 'Ok
Sheets("Current").Range("A1", Range("B3").End(xlDown)) 'Ok
Sheets("Other").Range("A1:B3") 'Ok
Sheets("Other").Range("A1", Range("B3").End(xlDown)) 'NOk

Is there a reason the range().End() does not work ?

Thanks in advance.

Upvotes: 0

Views: 137

Answers (1)

Davesexcel
Davesexcel

Reputation: 6982

Sheets("Other").Range("A1", Sheets("Other").Range("B3").End(xlDown))

Upvotes: 3

Related Questions