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: 143
Default Named Ranges

I want to pick up row 2- column 2 as ACAPSBranchList and row 1 column 1 as ACAPSNoteList. I wrote the following code for the acapsnotelist and it worked so I just added some code for the second named range but it picks up column 1 & 2 for instead of just column 2. What am I doing wrong? Can I have two named ranges in the same code or do I need to write a whole new sub? Please help!

Dim StrGivenRange As String
Dim strTopLeftCorner As String
Dim strBottomRightCorner As String
Dim strSheetName As String

StrGivenRange = ""
strTopLeftCorner = ""
strBottomRightCorner = ""

Application.Worksheets("ACAPS").Activate
Range("A65536").Activate
Selection.End(xlUp).Activate

strBottomRightCorner = ActiveCell.Address(, , xlR1C1)
StrGivenRange = "=ACAPS!R2C1:" & strBottomRightCorner
ActiveWorkbook.Names.Add Name:="ACAPSNoteList", RefersToR1C1:=StrGivenRange
strBottomRightCorner = ActiveCell.Address(, , xlR1C1)
StrGivenRange = "=ACAPS!R2C2:" & strBottomRightCorner
ActiveWorkbook.Names.Add Name:="ACAPSBranchList", RefersToR1C1:=StrGivenRange

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
Like 123, allow named ranges, and print named ranges WP Excel Discussion (Misc queries) 1 April 8th 05 06:07 PM
Named Ranges Donna Excel Discussion (Misc queries) 3 February 1st 05 11:35 PM
named ranges - changing ranges with month selected gr8guy Excel Programming 2 May 28th 04 04:50 AM
named ranges, I think inquirer Excel Programming 2 May 4th 04 03:27 AM
Named Ranges and VBA Add-ins Tom Ogilvy Excel Programming 0 September 4th 03 09:58 PM


All times are GMT +1. The time now is 10:02 PM.

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

About Us

"It's about Microsoft Excel"