Can someone give me an example showing code to add a name to the names
collection and to assign the name to a range reference such as,
"mynamesfile.xls!customername"
Thanks,
Keith
Can someone give me an example showing code to add a name to the names
collection and to assign the name to a range reference such as,
"mynamesfile.xls!customername"
Thanks,
Keith
Hi Keith,
I though that I had - in response to you other posts in the Excel group.
---
Regards,
Norman
"keithb" <[email protected]> wrote in message
news:[email protected]...
> Can someone give me an example showing code to add a name to the names
> collection and to assign the name to a range reference such as,
> "mynamesfile.xls!customername"
>
> Thanks,
>
> Keith
>
The first instance add the name MyNameRange to range A1 to E5, if you need
to do this under program control it might be easier to use the second
version that specifies the row and column numbers (also range A1 to
E5)....., prefix the Range with Worksheets("MySheet") if it is not on the
active sheet.
ActiveWorkbook.Names.Add Name:="MyNameRange", _
RefersTo:=Range("A1:E5")
ActiveWorkbook.Names.Add Name:="MyNameRange", _
RefersTo:=Range(Cells(1, 5), Cells(5, 5))
--
Cheers
Nigel
"keithb" <[email protected]> wrote in message
news:[email protected]...
> Can someone give me an example showing code to add a name to the names
> collection and to assign the name to a range reference such as,
> "mynamesfile.xls!customername"
>
> Thanks,
>
> Keith
>
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks