Thanks, as a novice I have run the macro, but it only creates a new sheet. How do I configure it to identify the specific rows and ranges that need to be duplicated and then have it copy to the new worksheet?
The third column will be the identifier where the record is greater than 1 for that row to duplicated the number of times it is identified as.
Main Topics
Browse All Topics





by: hiteshgoldeneyePosted on 2007-08-06 at 10:52:37ID: 19640091
'try this macro
t mns.Count rkbook.She ets.Count) .Count k.Sheets(s heetindex) .Rows(srow ) tindex).Ce lls(srow,c ol+1) = k
Sub positionelements()
Dim currentvalue As Integer, srow As Integer, pos as Integer,sheetindex,col as Integer
srow = 2
pos=1
sheetindex = ActiveWorkbook.Sheets.Coun
col = ActiveSheet.UsedRange.Colu
ActiveWorkbook.Sheets.Add after:=Worksheets(ActiveWo
For i = 1 To ActiveSheet.UsedRange.Rows
pos = 1
currentvalue = Val(ActiveSheet.Cells(i, 1))
For k=1 to currentvalue
ActiveSheet.Rows(i).Copy Destination:=ActiveWorkboo
ActiveWorkbook.Sheets(shee
srow = srow + 1
Next
Next
End Sub