Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Wanting to write results to array instead of sheet, results overwriting....
Hi y'all
I have a problem, i have the following sub: Sub PrintIt() Range(Cells(9, 2 + Col), Cells(8 + UBound(b, 1), 2 + Col)).Value = b Col = Col + 1 End Sub However I want vba to write the results not in the defined range but in an array. However if I change the above sub in the following: Sub PrintIt() IntermediateArray = b Col = Col + 1 End Sub I get that the code overwrites itself and i only get one line of results. does anybody know how I can rewrite the code so it gets the same results only inside an array instead of written on a sheet? thanks a lot! rgds, Sarju |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Wanting to write results to array instead of sheet, results overwriting....
If "b" is a 2D array and IntermediateArray is dim'd as Variant, then
IntermediateArray should be identical to the "b" array. -- Regards, Tom Ogilvy wrote in message oups.com... Hi y'all I have a problem, i have the following sub: Sub PrintIt() Range(Cells(9, 2 + Col), Cells(8 + UBound(b, 1), 2 + Col)).Value = b Col = Col + 1 End Sub However I want vba to write the results not in the defined range but in an array. However if I change the above sub in the following: Sub PrintIt() IntermediateArray = b Col = Col + 1 End Sub I get that the code overwrites itself and i only get one line of results. does anybody know how I can rewrite the code so it gets the same results only inside an array instead of written on a sheet? thanks a lot! rgds, Sarju |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Wanting to write results to array instead of sheet, results overwr
you are only getting one result because you do not cycle through col values
For col = 1 to 'whatever ''''YOURCODEHERE ''drop your col = col + 1 line next col " wrote: Hi y'all I have a problem, i have the following sub: Sub PrintIt() Range(Cells(9, 2 + Col), Cells(8 + UBound(b, 1), 2 + Col)).Value = b Col = Col + 1 End Sub However I want vba to write the results not in the defined range but in an array. However if I change the above sub in the following: Sub PrintIt() IntermediateArray = b Col = Col + 1 End Sub I get that the code overwrites itself and i only get one line of results. does anybody know how I can rewrite the code so it gets the same results only inside an array instead of written on a sheet? thanks a lot! rgds, Sarju |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
select data and write results to new worksheet in same workbook | Excel Discussion (Misc queries) | |||
Exclude 0 from MIN array results | Excel Discussion (Misc queries) | |||
Conditional Sum Argument results do not equal cell results Excel | Excel Worksheet Functions | |||
Macro to write to webpage & query results | Excel Programming | |||
How can I list the results of my macro without overwritng previous results? | Excel Programming |