Hello,
I am new to loops but learning. I cannot figure out why I am getting a compile error:
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
I am new to loops but learning. I cannot figure out why I am getting a compile error:
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: