use vaiable for all sheets
the following is a trivial example
dim sub test{}
dim dest as range
set dest=range("a1").end(xldown)
with workshees("sheet3")
msgbox dest.address
end with
with worksheets("sheet2")
msgbox dest.address
end iwth
end sub
will the first msgbox show the last cell in sheet 3 column A and second box
show the corresponding cell in sheet 2 even though neither of these sheets
are active sheets
or
am I to wrie a line activating the sheet each time and then write msgbox
line.
I hope I am clear.
thanks.
..
|