Hi All, i have the below code at the moment it just runs on cell Z1 but i want it to move down column Z fetching the data until the cells are blank so the code would run complete Z1 then loop round dropping to Z2 etc. how do i add the loop in?
Code:
Option Explicit
Sub Find_Data()
Dim casenumber As String
Dim finalrow As Integer
Dim i As Integer
Sheets("Data").Range("AD2:AV400").ClearContents
casenumber = Sheets("Data").Range("Z1").Value
finalrow = Sheets("Data").Range("A10000").End(xlUp).Row
For i = 2 To finalrow
If Cells(i, 1) = casenumber Then
Range(Cells(i, 1), Cells(i, 19)).Copy
Range("AD1000").End(xlUp).Offset(1, 0).PasteSpecial xlPasteFormulasAndNumberFormats
End If
Next i
Range("Z:Z").Select
casenumber = casenumber + 1
Loop
End Sub