stirlingmw
Board Regular
- Joined
- Feb 18, 2013
- Messages
- 75
I have the following code attached to a commandbutton on a sheet which clears the content of a selected cell and if an autoshape is present this is deleted too.
My problem is when I designed the spreadsheet at home I was running Office 2013, but at work where I use the spreadsheet they run Office 2003 and this part of the code does not seem to work, any ideas??
Private Sub ClearSelectionFill()
Dim sh As Shape
Selection.Interior.Color = xlNone
Selection.ClearContents
For Each sh In ActiveSheet.Shapes
If Not Intersect(Selection, sh.TopLeftCell) Is Nothing Then
sh.Delete
End If
Next sh
End Sub
My problem is when I designed the spreadsheet at home I was running Office 2013, but at work where I use the spreadsheet they run Office 2003 and this part of the code does not seem to work, any ideas??
Private Sub ClearSelectionFill()
Dim sh As Shape
Selection.Interior.Color = xlNone
Selection.ClearContents
For Each sh In ActiveSheet.Shapes
If Not Intersect(Selection, sh.TopLeftCell) Is Nothing Then
sh.Delete
End If
Next sh
End Sub