Hi all,
I'm trying (with little success being very new to this!) to write a VBA code to copy a row and paste it a number of times below based on the value in a cell within the same row. Columns A-T are populated with a checklist and column U tallies the entries to give a numerical number, and the idea is that each checked Column should have its own row. An example would be....
1| X X X X 4 // This is what the spreadsheet currently looks like, where "4" is in column U
1| X X X X 4 // This is what I am hoping to achieve
2| X X X X 4
3| X X X X 4
4| X X X X 4
My code is as follows:
The code successfully steps through each row in column U and identifies which has to be copied, copies the row and pastes into a new row below - the issue I have is that after the outer For Next loop the Active Cell moves back to Row 2, when I need it to skip over the newly inserted rows and look at row 5. I have tried to offset the active cell within the internal loop but the final Next seems to overwrite this back to row 5.....Please Login or Register to view this content.
Hopefully I've explained my issue well enough - any help would be appreciated!
(I think the easiest solution might be to insert ABOVE the copied row, but offsetting it seems to go up 2 rows, any tips?!)
Bookmarks