range name define on non active(focused) sheet
As always, you should post your code for comments.
Try something like this:
ThisWorkbook.Names.Add Name:="TestRng",
RefersTo:=Worksheets("Sheet2").Range("A1")
Regards,
Per
On 21 Jan., 10:50, ell wrote:
VBA Code range name define on other sheet
I use more than one sheet,
the focus is on sheet1
how I can , define a range name (with Names object let say) on sheet2
while the focus ,means active screen, is on sheet1.
I got an error that the application object of range name (in sheet2)
is not defined...
if I make active sheet as sheet2 , it works correctly
any help will be appreciated
EL
|