Allen Prince
asked on
How to create a named range in a remote workbook/worksheet
To create a named range within the active workbook/sheet I use:
intersect(activesheet.used range,Rang e("A:G")). SpecialCel ls(xlCellT ypeVisible ).Name = "TheName"
How could I modify this to create a named range for the used cells in a worksheet within a remote workbook
intersect(activesheet.used
How could I modify this to create a named range for the used cells in a worksheet within a remote workbook
Clarify what you mean by remote. Is it on a network and will it be open?
ASKER
the sheet is open on the local computer
it works if I place the code in the same workbook
if tied to a sheet in another workbook
I receive the error:
Run-time error 1004
Application-defined or Object-defined error
or in a module within a separate workbook:
Run-time error 1004
Method 'Intersect' of object '_Global failed
it works if I place the code in the same workbook
if tied to a sheet in another workbook
I receive the error:
Run-time error 1004
Application-defined or Object-defined error
or in a module within a separate workbook:
Run-time error 1004
Method 'Intersect' of object '_Global failed
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Works like a charm :)
If the Workbook is already open
set wb = Workbooks("myWorkbook.xlsm
intersect(wb.activesheet.u
Regards