chirayu
Well-Known Member
Hi Guys,
I'm sure I've read this somewhere. I think the macro uses a For Loop to create an Array of Rows that meet Criteria and then copies them all in 1 go to desired sheet. But can't seem to find the link for the life of me.
Example
Column A = Fruit Name e.g. Apple, Orange, Banana, Watermelon
Column B to D = Yearly Average Price e.g. 2015,2016,2017 prices
File has a sheet name for each of the fruits so using above example - there should be four sheets already created in the file with each sheet being named after the fruit
Based on above example then firstly the macro would either count number of sheets (minus main data sheet that has all fruits) or count unique fruit names from the data sheet. So that it know how many times to run the loop over the range
Secondly, during the loop the macro will loop through the range for each of the unique fruit names/ sheet names and build an array of rows that have the specific fruit name.
Thirdly it will use this array to copy specific row number e.g. from column A:D to the respective sheet that has the same fruit name.
Essentially I'm trying to figure out a way to work on a large dataset & distribute it to respective sheets without going line by line using Do Until/Do While
I'm sure I've read this somewhere. I think the macro uses a For Loop to create an Array of Rows that meet Criteria and then copies them all in 1 go to desired sheet. But can't seem to find the link for the life of me.
Example
Column A = Fruit Name e.g. Apple, Orange, Banana, Watermelon
Column B to D = Yearly Average Price e.g. 2015,2016,2017 prices
File has a sheet name for each of the fruits so using above example - there should be four sheets already created in the file with each sheet being named after the fruit
Based on above example then firstly the macro would either count number of sheets (minus main data sheet that has all fruits) or count unique fruit names from the data sheet. So that it know how many times to run the loop over the range
Secondly, during the loop the macro will loop through the range for each of the unique fruit names/ sheet names and build an array of rows that have the specific fruit name.
Thirdly it will use this array to copy specific row number e.g. from column A:D to the respective sheet that has the same fruit name.
Essentially I'm trying to figure out a way to work on a large dataset & distribute it to respective sheets without going line by line using Do Until/Do While