Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub extractdata()
- Dim x As Long, lastrow1, lastrow2
- lastrow = Sheets("Perk").Range("A" & Rows.Count).End(xlUp).Row
- Sheets("Housing").Range("A2:AW500").ClearContents
- Sheets("Registration").Range("A2:AW500").ClearContents
- For x = 2 To lastrow
- If Cells(x, 1) Like "y*" Or Cells(x, 1) Like "Y*" Then
- Worksheets("Perk").Cells(x, "A").EntireRow.Copy Destination:=Sheets("Registration").Range("A" & Rows.Count).End(xlUp).Offset(1)
- ElseIf Cells(x, 2) Like "y*" Or Cells(x, 2) Like "Y*" Then
- Worksheets("Perk").Cells(x, "A").EntireRow.Copy Destination:=Sheets("Housing").Range("A" & Rows.Count).End(xlUp).Offset(1)
- End If
- Next x
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement