Removing macro buttons from part of a sheet

  • Thread starter Thread starter Tim Childs
  • Start date Start date
T

Tim Childs

Hi

the redoubtable DP (very helpfully) gave me this code to remove all
the buttons from a spreadsheet. In reality I want to restrict the
removal to buttons in Column A only. (there are 100+). Alternatively,
I want to remove all the buttons except for one in Column C. It may
sound odd but it is true!

Please can someone give me a start on revising the code

Thanks

Tim

Set CurWks = ActiveSheet

With CurWks
'Suppressed as it deletes the clear clipboard button
'.buttons.delete
 
Hi Don

Thanks for the post

Any chance of a bit more detail on the code too control
that deletion

Regards

Tim
 
The following code deletes buttons in columns other than C:

Sub ClearButtons()
Dim CurWks As Worksheet
Dim btn As Button
Set CurWks = ActiveSheet

For Each btn In CurWks.Buttons
If btn.TopLeftCell.Column <> 3 Then
btn.Delete
End If
Next
End Sub
 
Back
Top