LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Setting variable names in code

Hi
I would use an array variable for this. have a look for array variables
in the vBA help
e.g.
dim xp(10)
xp(1)="hello"
xp(2)="world"
msgbox xp(1) & " " & xp(2)



--
Regards
Frank Kabel
Frankfurt, Germany


Newbie wrote:
Hi,

I would like to know how to set a variable name in code.
I need a number of variable, eg xp01, xp03, xp06 etc where the last
two digits are dependent on cell values.

At the moment I am typing them into the code manually i.e. xp01 =
"whatever": xp03 = 4 etc and listing all the xp**.
So if someone could tell me how to build the variable name within
VBA, I could then loop the the sheet to set the variable values.

TIA


 
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
using the Excel generic worksheet names instead of user-given names in code Paul Excel Discussion (Misc queries) 5 June 26th 09 08:44 PM
Setting the cell number as a variable Intern Excel Discussion (Misc queries) 1 June 5th 09 08:41 PM
can i link a variable cost code with a variable sum I need help!! Excel Discussion (Misc queries) 0 August 1st 08 11:40 AM
Setting up variable summary sheet. shakey1181 Excel Discussion (Misc queries) 4 August 18th 06 01:37 PM
Setting up a variable print range Gary[_5_] Excel Programming 5 July 31st 03 04:32 AM


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