Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
selecting and viewing a range | Charts and Charting in Excel | |||
Listing or Changing all Defined Range Names (using VBA) | Excel Programming | |||
Selecting range in list of range names depending on a cell informa | Excel Discussion (Misc queries) | |||
listing and selecting data | Excel Worksheet Functions | |||
selecting and listing data | Excel Worksheet Functions |