Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default 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
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
Not at all clear on use of variables and/or object variables JMay-Rke Excel Discussion (Misc queries) 11 July 4th 08 06:36 PM
VBA Variables.... MarkHear1 Excel Programming 12 February 15th 07 02:34 PM
Variables... Help! Graeme Excel Programming 4 July 21st 06 03:47 PM
SUM IF and two variables Leigh Ann Excel Worksheet Functions 6 May 25th 05 03:24 AM
Variables Phil Excel Programming 1 April 15th 05 04:39 PM


All times are GMT +1. The time now is 04:12 PM.

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"