Hi
Thanks for your help previously - the solution you gave has been working well.
However I have tried to modify it slightly by only returning data that meets a certain criteria. However whilst it works it also brings back blank cells (where I presume the data that I do not want to be returned would have been).
Do you know how I can copy only the data that I want (as therefore no blank spaces are copied over) please??
Here is the modified code to what you helped me with below. I have also attached an example worksheet.
Sub Dump()
Dim lastrow As Long, erow As Long
lastrow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Row
Application.ScreenUpdating = False
erow = Sheet2.Cells(Rows.Count, 8).End(xlUp).Offset(3, 0).Row
For i = 2 To lastrow
If Sheet1.Range("R" & erow).Value = "Active" Then
Worksheets("Status Active UIN's").Cells(erow, 1).Value = Sheet1.Cells(i, 7).Value
Worksheets("Status Active UIN's").Cells(erow, 2).Value = Sheet1.Cells(i, 2)
Worksheets("Status Active UIN's").Cells(erow, 3).Value = Sheet1.Cells(i, 8)
Worksheets("Status Active UIN's").Cells(erow, 4).Value = Sheet1.Cells(i, 18)
End If
erow = erow + 1
Next i
Application.CutCopyMode = False
Sheet2.Columns().AutoFit
Range("A1").Select
Application.ScreenUpdating = False
End Sub
Bookmarks