Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Variables Name
Hi I have to define 20 variables all of then have similar name for example :
Name13 Name14 Name15 Name16 Can I do something like "Name" & nRow = Value ? Thank you in advance. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Variables Name
You are probably better off with an array something like this...
Sub test() Dim strNames(1 To 20) As String strNames(1) = "Tom" strNames(2) = "Dick" strNames(3) = "Harry" End Sub -- HTH... Jim Thomlinson "Angeles" wrote: Hi I have to define 20 variables all of then have similar name for example : Name13 Name14 Name15 Name16 Can I do something like "Name" & nRow = Value ? Thank you in advance. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Variables Name
Why not declare an array of appropriate dimension to hold the values
instead? Then you could reference the value you needed by its index instead of declaring 20 variables of the same type holding the same type of information. "Angeles" wrote in message ... Hi I have to define 20 variables all of then have similar name for example : Name13 Name14 Name15 Name16 Can I do something like "Name" & nRow = Value ? Thank you in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Not at all clear on use of variables and/or object variables | Excel Discussion (Misc queries) | |||
VBA Variables.... | Excel Programming | |||
Variables... Help! | Excel Programming | |||
SUM IF and two variables | Excel Worksheet Functions | |||
Variables | Excel Programming |