Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Old style programming using Arrays
I have some data in a spreadsheet and want to do some complex things with it.
In the 'old days of GWBASIC' - before spreadsheets - I would set up the following lines of programming:- Dim table(40,60) For i=1 to 40:for j=1 to 60 Read table(i,j) next j:next i Then I would analyse the data in the array. I know that macros can handle the for/next loops but what are the equivalent lines for setting up a 2 dimensional array and then getting the data from the spreadsheet? Any help would be appreciated. Thanks Under Pressure |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Old style programming using Arrays
Another way is to just work on each cell in the range.
Dim myRng as range dim myCell as range dim wks as worksheet set wks = activesheet with activesheet set myrng = .range("x99").resize(40,60) '40 rows by 60 columns end with for each mycell in myrng.cells 'do something with that cell msgbox mycell.value & vblf & mycell.address(0,0) next mycell Under Pressure wrote: I have some data in a spreadsheet and want to do some complex things with it. In the 'old days of GWBASIC' - before spreadsheets - I would set up the following lines of programming:- Dim table(40,60) For i=1 to 40:for j=1 to 60 Read table(i,j) next j:next i Then I would analyse the data in the array. I know that macros can handle the for/next loops but what are the equivalent lines for setting up a 2 dimensional array and then getting the data from the spreadsheet? Any help would be appreciated. Thanks Under Pressure -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Programming style with worksheet functions - discussion invited | Excel Worksheet Functions | |||
How to stop style for col A changing to style of co D date vs $ | Setting up and Configuration of Excel | |||
How do I change sheet notation from R1C1 style to A1 style in XL 2 | Setting up and Configuration of Excel | |||
How do I convert US style dates to European style? | Excel Discussion (Misc queries) | |||
A1 style Range in programming | Excel Programming |