Link to home
Start Free TrialLog in
Avatar of Diane Lonergan
Diane LonerganFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Excel vba to manipulate data

Please see attached sample. Using sheet1 as the source, I would like a piece of vba to move each row to an output sheet. For each row it would check cell R to see if the series number had changed. When it detects that it has changed it will need to position back to the rows preceding the change in column R value and overwrite cell A for all rows that have the same value in cell R with the very last value of cell A that it finds in the series. Probably easier to understand when looking at the sample output.

Each entire row including the header row should be copied to the output sheet. There will be 1000's of rows in my real data.
sample-docseries.xlsx
Avatar of Roy Cox
Roy Cox
Flag of United Kingdom of Great Britain and Northern Ireland image

I would like a piece of vba to move each row to an output sheet. For each row it would check cell R to see if the series number had changed

This is not difficult, I've posted many such examples.

How would the code know it has changed? I would normally just run the code to overwrite the existing data on the separate sheets
Will it always be in order on Column R?
Avatar of Diane Lonergan

ASKER

Thanks Guys for your questions. In reply....

It should be sorted by column, but just in case it would be safer to have a sort on this column at the start of the script.

Regarding data change, this is a migration I'm doing all iterations so it would be manually run and the vba would be run by me on demand
ASKER CERTIFIED SOLUTION
Avatar of JP
JP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Superb, Thank You JP.
Thanks for help. Really appriciated