LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Creating a name with VBA

I have an obscure problem. I have simplified it down to the code below. I
am trying to create a named range with VBA but the range name has inverted
commas around it so it will not work. For example, the code below creates a
named range for ResourceList of:
="Sheet2!$A$1:$A$3" rather than =Sheet2!$A$1:$A$3 (with no inverted commas)

"Sub test()
Dim strStart As String
Dim strEnd As String
Dim strAddress As String

strStart = "$A$1"
strEnd = "$A$3"

strAddress = ActiveWorkbook.Name & "!" & strStart & ":" & strEnd
ActiveWorkbook.Names.Add Name:="ResourceList", RefersToR1C1:=strAddress
End Sub

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
creating a new key kate Excel Discussion (Misc queries) 1 August 28th 09 10:48 AM
creating Yes,No Amin Excel Discussion (Misc queries) 3 November 8th 08 10:02 PM
Creating Id shail Excel Worksheet Functions 8 September 14th 06 06:30 PM
Really need help creating pop ups mward77095 Excel Discussion (Misc queries) 3 May 8th 06 09:34 PM
Creating a Log Patrick Excel Programming 4 April 7th 05 01:51 PM


All times are GMT +1. The time now is 02:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"