Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In VBA, how does one make a reference to a dynamic veraiable?
If I have named ranges "ABC1" thru "ABC9". User enters "5" so I want to get the value of range "ABC5". Without using Case statements. Thanks -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() RangeName = "ABC" & Format$(n) where n contains the number the user entered. On Sat, 7 Aug 2004 20:15:48 -0500, RNM wrote: In VBA, how does one make a reference to a dynamic veraiable? If I have named ranges "ABC1" thru "ABC9". User enters "5" so I want to get the value of range "ABC5". Without using Case statements. Thanks, --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How about if I need to reference a variable, not a range.
user enters a number(1-9). I need to put a value in variable either "a1", "a2",... or "a9" without using case statement Thank you -- Message posted from http://www.ExcelForum.com |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
RNM wrote:
How about if I need to reference a variable, not a range. user enters a number(1-9). I need to put a value in variable either "a1", "a2",... or "a9" without using case statement Thank you, --- Message posted from http://www.ExcelForum.com/ Use an array. Dim a(1 To 9) As Integer ' Or whatever other variable type This single statement gives you 9 variables: a(1), a(2), a(3), ... until a(9). And then you use a(n) where n is the number the user entered. -- Amedee Van Gasse using XanaNews 1.16.3.1 If it has an "X" in the name, it must be Linux? Please don't thank me in advance. Thank me afterwards if it works or hit me in the face if it doesn't. ;-) I found 2 small shortcomings on www.excelforum.com: 1. You do *not* have to pay for access to news:msnews.microsoft.com 2. A *real* newsreader (not Outlook Express) is actually very easy to use. See www.newsreaders.com for more info. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need to replace one dynamic variable with another dynamic variable | Excel Worksheet Functions | |||
How do i set up a 3d reference where one cell reference is dynamic | Excel Discussion (Misc queries) | |||
Dynamic Variable Name | Excel Programming | |||
Refreshing a dynamic range variable | Excel Programming | |||
Create dynamic variable names? | Excel Programming |