macro to delete all labels
If by "labels" you mean Label controls (from either the Forms toolbar or the
Control Toolbox toolbar), then read on.
Your question wasn't clear about whether you wanted every label on every
worksheet deleted or only the labels on a specific worksheet. Here is the
code for removing the labels from *all* worksheets...
Sub DeleteAllLabelControls()
Dim WS As Worksheet
Dim Lbl As OLEObject
For Each WS In Worksheets
WS.Labels.Delete
For Each Lbl In WS.OLEObjects
Lbl.Delete
Next
Next
End Sub
Here is how to remove them from a single worksheet (assumed to be named
Sheet1 for this example)...
Sub LabelControlsFromSheet1()
Dim Lbl As OLEObject
With Worksheets("Sheet1")
.Labels.Delete
For Each Lbl In .OLEObjects
Lbl.Delete
Next
End With
End Sub
--
Rick (MVP - Excel)
"Lynn" wrote in message
...
hi,
anyone has a macro to delete all labels in a spreadsheet?
|