Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi am trying to write some vba code that will adapt with my very variable
data. As such, I am using arrays, etc. The basics work, but I have now hit a little bump in the road that I hope someoe can show me how to get around. Basically, for each item in the array, I need to store certain value into variable. I was trying to build these variable using the array item number, but don't seem to be able to get the code right. For instance, For i = LBound(Array1) to UBound(Array1) 'I perform a filter on my data here (Removed to simplify my code) "Sub" & Array1(i) = Range("SubTotal").Value Next i Basically I want to create a series of sequential variable holding the values: Sub1 = Sub2 = Sub3 = How can this be done? QB |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Sub test() Dim Mytotals() As Variant ReDim Mytotals(LBound(Array1) To UBound(Array1)) For i = LBound(Array1) To UBound(Array1) Mytotals(i) = Range("SubTotal").Value Next i End Sub -- joel ------------------------------------------------------------------------ joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=157526 Microsoft Office Help |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Variable variables and sub routines | Excel Programming | |||
Passing Variable length Space Characters to Variables | Excel Programming | |||
Select one variable from a list of variables by clicking one cell | Excel Discussion (Misc queries) | |||
Newbie Macro Query - Clearing Variables and Assigning a Variable | Excel Programming |