Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default Listing/Selecting/Viewing Range Names

I am trying to set names for a range of cells by something like this...

Private Sub SetRangeName()
Dim RowID
Dim rngType, rngNum, rngName

RowID = ActiveCell.Row
rngType = "INFO"
rngNum = "1"

*** At this point I need to somehow FIND the next available number and
change the rngNum to it ***

rngName = rngType & "_" & rngNum

Range("A" & RowID & ":F" & RowID + 9).Select
Selection.Name = rngName

I want to set the names by selecting Cell A7 and then use a CommandButton to
automatically select the cells and apply the name, then I select A17 and do
the same.

How do I find the next available number?

Then I want to create a list of all the range names and apply them to a
selectable drop-down list in Cell A5? And when I select a range name from the
drop-down list all the other cells are hidden or at the very least the
selected range is displayed.

That's alot but I'm hoping that it's able to be done.

Thanks in Advance.
Rob
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Listing/Selecting/Viewing Range Names

Private Sub SetRangeName()
Dim RowID As Long
Dim rngNum As Long
Dim rngType As String
Dim rngName As String

RowID = ActiveCell.Row
rngType = "INFO"
rngNum = 1

'*** At this point I need to somehow FIND the next available number and
'change the rngNum to it ***

rngNum = rngNum + 1

--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Rob"
wrote in message
I am trying to set names for a range of cells by something like this...

Private Sub SetRangeName()
Dim RowID
Dim rngType, rngNum, rngName

RowID = ActiveCell.Row
rngType = "INFO"
rngNum = "1"

*** At this point I need to somehow FIND the next available number and
change the rngNum to it ***

rngName = rngType & "_" & rngNum

Range("A" & RowID & ":F" & RowID + 9).Select
Selection.Name = rngName

I want to set the names by selecting Cell A7 and then use a CommandButton to
automatically select the cells and apply the name, then I select A17 and do
the same.
How do I find the next available number?
Then I want to create a list of all the range names and apply them to a
selectable drop-down list in Cell A5? And when I select a range name from the
drop-down list all the other cells are hidden or at the very least the
selected range is displayed.
That's alot but I'm hoping that it's able to be done.
Thanks in Advance.
Rob
Reply
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
selecting and viewing a range paweston Charts and Charting in Excel 1 May 18th 10 04:22 PM
Listing or Changing all Defined Range Names (using VBA) Post Tenebras Lux Excel Programming 5 July 15th 06 04:24 PM
Selecting range in list of range names depending on a cell informa Courreges Excel Discussion (Misc queries) 2 June 19th 06 10:59 AM
listing and selecting data parthi_75 Excel Worksheet Functions 0 November 3rd 05 12:21 PM
selecting and listing data Brian Excel Worksheet Functions 9 November 9th 04 06:55 PM


All times are GMT +1. The time now is 09:23 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"