Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. 'finding last record in my initial list
  2. sheet_last_row = Sheets("mylist").Range("A" & Rows.Count).End(xlUp).Row
  3.  
  4. For i = 2 To sheet_last_row
  5. last_row = Sheets("results").Cells(Rows.Count, 1).End(xlUp).Row
  6.  
  7. If Sheets("mylist").Cells(i, 1).Value = 2 Then
  8. 'test if cell is merged
  9. If Sheets("mylist").Cells(i, 2).MergeCells Then
  10. RowCount = Sheets("mylist").Cells(i, 2).Value
  11.  
  12. End If
  13. Sheets("mylist").Cells(i, 1).EntireRow.Copy Sheets("results").Cells(last_row + 1, 1)
  14. End If
  15.  
  16. Next i
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement