Hello,
Another board member provided me with this VBA but has since vanished, leaving me with an error. I am teaching myself about loops (pretty cool!), but still cant figure out what is missing. I get a compile error, with the first Next highlighted. But I think its the start of the code that's wrong, not the end? But I am still just learning about loops.
Another board member provided me with this VBA but has since vanished, leaving me with an error. I am teaching myself about loops (pretty cool!), but still cant figure out what is missing. I get a compile error, with the first Next highlighted. But I think its the start of the code that's wrong, not the end? But I am still just learning about loops.
Code:
Sub DeleteRowsandComboboxes()
Dim Cel As Range
Dim Shp As Shape
Dim ro As Integer
Set Cel = Cells(1, 1)
Do Until Cel.End(xlDown).Row = 1048576
Set Cel = Cel.End(xlDown)
ro = Cel.Row
If Cel = "Yes" Then
Rows(ro).Delete
Set Cel = Cells(ro, 1)
Else
Set Cel = Cel.End(xlDown)
End If
Next
For Each Shp In ActiveSheet.Shapes
If Shp.Type = 8 Then
Shp.Select
If Selection.LinkedCell = "#REF!" Then Shp.Delete
End If
Next
End Sub
Last edited by a moderator: