Hi All,
I'm trying to copy data from a summary sheet to other worksheets.
I have a site Id, which starts from 1-X(x being the input value from user), at the same time, my code creates X number of worksheets. I need to copy data such that, information on Row 1 is copied to 1st worksheet in X, information on row 2 is copied to 2nd worksheet in X. etc,etc.
I have been trying for the past two weeks, and I'm not getting anywhere.
Any help Would be much appreciated.
Last edited by Booms; 09-21-2011 at 10:14 AM.
Your question is a lil confusing. You are saying that the Info on row 1 should be copied to the 1st worksheet in X. Is X a workbook?
No, X is a worksheet, in the same workbook
How about this ...
Sub DuplicateRows() Dim lSheetLoop As Long For lSheetLoop = 2 To ThisWorkbook.Sheets.Count ThisWorkbook.Sheets(lSheetLoop).Rows(1).Value = ThisWorkbook.Sheets(1).Rows(lSheetLoop - 1).Value Next lSheetLoop End Sub
Hi Andrew-R
Sorry i should have been more specific. On the summary sheet, the information to be copied from starts at Row 5 going down to X. so i need to start duplicating from row 5.
Also when it is copied over to the othersheets(X sheets) i need it to paste in row 2( row 1 has header information)
I did use the code you gave, and am able to understand what's happening, and how it works, so thank you for your reply, but if you can help further that would be great.
Thanks
OK, they're fairly minor chages...
Should be it.Sub DuplicateRows() Dim lSheetLoop As Long For lSheetLoop = 2 To ThisWorkbook.Sheets.Count ThisWorkbook.Sheets(lSheetLoop).Rows(2).Value = ThisWorkbook.Sheets(1).Rows(lSheetLoop+3).Value Next lSheetLoop End Sub
Andrew-R, you are great!!!!!
Thank You, so much for your help!! It works like a charm!![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks