View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Roger Govier Roger Govier is offline
external usenet poster
 
Posts: 2,886
Default Storing variable values in Excel worksheet

Hi Henry

You would need something like

Dim i as long, x as long
Dim y as String, z as string

For i = 1 to 55
x = Range("A" & i).Value : y = Range("B" & i).Value : z = Range("C" &
i).Value

do your stuff with these
Next i


--
Regards

Roger Govier


"Henry Stockbridge" wrote in message
oups.com...
Hello,

I have created a Userform that will automate the
building of 55 Excel workbooks. Instead of
hardcoding the variables in a VBA module,
I would like to store the values in an underlying
worksheet, (A1:C55) and loop through the values.

How would I do this?

The spreadsheet data would look like this...

A B C
1 North Area_01 IC_Regn_01
2 North Area_01 PI_Regn_01
3 South Area_02 IC_Regn_04

... and would be called using something like

Dim x as Territory
Dim y as Area
Dim z as Region

Do Until ???

' Do something with x
' Do something with y
' Do something with z

Loop

Any help you can lend would be appreciated.

Henry