View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Please help Please help is offline
external usenet poster
 
Posts: 75
Default Please help with my code

Good morning,

Please help with my code below.

Basically, my code will remove the shapes in the cells selected (instead of
all the shapes in the active worksheet) of the active worksheet, and it is
not work.

For example, if I select cells A1, B1, and C5:G10 and when I run the macro,
the macro will only remove the shapes in those cells. Please note the cells
selected will be done by users and may not be the same as referenced above.

Thanks.

Dim cMarks As Shape
Dim sCells as Range
Dim cCount as Integer

sCells.Select
For Each sCells In ActiveSheet
For Each cMarks In sCells.Shapes
If cMarks.Type = 13 Then
cCount = cCount + 1
cMarks.Delete
End If
Next cMarks
Next sCells
MsgBox "You have removed " & cCount & " check marks in highlighted cells
'" & sCells.Name & "' of the Worksheet '" &
ActiveSheet.Name & "'."