LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Check for the existence of data labels

Dear Experts:

below macro ...
.... deletes any data labels from all data series of all charts on the
active worksheet.

I wonder whether the macro could check at the beginning ...
.... for the existence of any data labels (1 to n) and if there are
none at all come up with a msgbox telling the user ('All data labels
have already been deleted!').

Help is much appreciated.Thank you very much in advance.

Regards, Andreas

Sub DataLabels_Remove()

Dim ChtObj As ChartObject
Dim i As Integer
Dim ser As Series
i = 0

For Each ChtObj In ActiveSheet.ChartObjects
With ChtObj.Chart
For Each ser In .SeriesCollection
ser.ApplyDataLabels (xlDataLabelsShowNone)
Next ser
End With
Next

End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Range existence check DoctorG Excel Programming 6 July 13th 06 04:31 PM
Check for existence CWillis Excel Discussion (Misc queries) 3 May 31st 06 01:20 PM
VBA to check for existence of a DSN GPO Excel Programming 2 May 29th 06 05:22 AM
How do I check for existence of a worksheet? LizzieHW Excel Worksheet Functions 1 July 19th 05 06:22 PM
Code to check existence No Name Excel Programming 2 November 4th 04 01:50 PM


All times are GMT +1. The time now is 11:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"