csilabgirl
Active Member
- Joined
- Aug 14, 2009
- Messages
- 359
Excel 2002
On Sheet1 I have a value in cell A15. On Sheet2 I have values in column B:B. The values in the B column are actually repeated for 16 rows before the value changes and then is repeated for another 16 rows.
What I want to be able to do is create a macro that will look at the value in cell A15 Sheet1 and then go to Sheet2 and delete the rows in which the value is also seen in the B column.
I have the following code which will delete rows when the A column is blank:
Dim i As Long
For i = Range("A" & Rows.Count).End(xlUp).Row To 1 Step -1
If Cells(i, 1).Value = "" Then Cells(i, 1).EntireRow.Delete
Next i
And I tried to amend it to do what I wanted but it didnt work. I wont post my amendment since it didnt work, but I could if it was needed.
Any help would be greatly appreciated. Thank you!
On Sheet1 I have a value in cell A15. On Sheet2 I have values in column B:B. The values in the B column are actually repeated for 16 rows before the value changes and then is repeated for another 16 rows.
What I want to be able to do is create a macro that will look at the value in cell A15 Sheet1 and then go to Sheet2 and delete the rows in which the value is also seen in the B column.
I have the following code which will delete rows when the A column is blank:
Dim i As Long
For i = Range("A" & Rows.Count).End(xlUp).Row To 1 Step -1
If Cells(i, 1).Value = "" Then Cells(i, 1).EntireRow.Delete
Next i
And I tried to amend it to do what I wanted but it didnt work. I wont post my amendment since it didnt work, but I could if it was needed.
Any help would be greatly appreciated. Thank you!