Hi Folks,
I'm running the below code...and it works fine...some of the time. Other times I get a runtime error but I can't figure out how to resolve it; any tips?
The bit where I get an error is;
I'm guessing something to do with the range dropping out?
Thanks in advance
I'm running the below code...and it works fine...some of the time. Other times I get a runtime error but I can't figure out how to resolve it; any tips?
The bit where I get an error is;
VBA Code:
For Each shp In ActiveSheet.Shapes
If Not Intersect(Range(shp.TopLeftCell, shp.BottomRightCell), r) Is Nothing Then _
I'm guessing something to do with the range dropping out?
VBA Code:
Sub delete_step()
Dim shp As Shape
Dim b As Object, RowNumber As Integer
Set b = ActiveSheet.Shapes(Application.Caller)
With b.TopLeftCell
myvalue = .Column
End With
Set r = Columns(myvalue)
For Each shp In ActiveSheet.Shapes
If Not Intersect(Range(shp.TopLeftCell, shp.BottomRightCell), r) Is Nothing Then _
shp.Select Replace:=False
Next shp
Selection.Delete
Columns(myvalue).Select
Selection.Delete Shift:=xlToLeft
Dim lastCol As Long
lastCol = Cells(9, Columns.Count).End(xlToLeft).Column
Range("G14").AutoFill Destination:=Range(Range("G14"), Cells(14, lastCol)), Type:=xlFillDefault
Call LinkCheckBoxes
End Sub
Thanks in advance
