A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Charts and Charting
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

DataLabel.Font.ColorIndex vs DataLabel.Text (Private Sub does not work in excel 2003)



 
 
Thread Tools Display Modes
  #1  
Old April 22nd, 2009, 01:28 PM posted to microsoft.public.excel.charting
God Itself
external usenet poster
 
Posts: 15
Default DataLabel.Font.ColorIndex vs DataLabel.Text (Private Sub does not work in excel 2003)

Hi,

i have sheet's code which works perfecly in Excel 2007, but nothing happens in excel 2003. No error occurs. what may be the cause?

Private Sub Worksheet_Calculate()'white label when value = NA()

With Workbooks("chart").Sheets("tmp").Shapes("Wykres 1").DrawingObject.Chart
For i = 1 To 7
.SeriesCollection(1).Points(i).DataLabel.Font.Colo rIndex = 0
Next i
For i = 1 To 7
If .SeriesCollection(1).Points(i).DataLabel.Text = "#N/D!" Then
.SeriesCollection(1).Points(i).DataLabel.Font.Colo rIndex = 2
End If
Next i
End With

End Sub

regards
  #2  
Old April 22nd, 2009, 01:51 PM posted to microsoft.public.excel.charting
Andy Pope
external usenet poster
 
Posts: 2,088
Default DataLabel.Font.ColorIndex vs DataLabel.Text (Private Sub does not work in excel 2003)

Hi,

The code works in xl03 if the workbook is saved as 97-03 compatible.
Add a break point on the first line and step through the code to see if all
the lines are executed as expected.

Cheers
Andy
--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"God Itself" wrote in message
...
Hi,

i have sheet's code which works perfecly in Excel 2007, but nothing happens
in excel 2003. No error occurs. what may be the cause?

Private Sub Worksheet_Calculate()'white label when value = NA()

With Workbooks("chart").Sheets("tmp").Shapes("Wykres
1").DrawingObject.Chart
For i = 1 To 7
.SeriesCollection(1).Points(i).DataLabel.Font.Colo rIndex = 0
Next i
For i = 1 To 7
If .SeriesCollection(1).Points(i).DataLabel.Text = "#N/D!" Then
.SeriesCollection(1).Points(i).DataLabel.Font.Colo rIndex = 2
End If
Next i
End With

End Sub

regards

  #3  
Old April 22nd, 2009, 02:39 PM posted to microsoft.public.excel.charting
God Itself
external usenet poster
 
Posts: 15
Default DataLabel.Font.ColorIndex vs DataLabel.Text (Private Sub does not work in excel 2003)

Hi,

i wrote code in xl07 and saved as 97-2003. i tried to open workbook in xl03 but code does not work (no effect)
"#N/D" labels are not whitened.

rgs

Użytkownik "Andy Pope" napisał w wiadomości ...
Hi,

The code works in xl03 if the workbook is saved as 97-03 compatible.
Add a break point on the first line and step through the code to see if all
the lines are executed as expected.

Cheers
Andy
--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"God Itself" wrote in message
...
Hi,

i have sheet's code which works perfecly in Excel 2007, but nothing happens
in excel 2003. No error occurs. what may be the cause?

Private Sub Worksheet_Calculate()'white label when value = NA()

With Workbooks("chart").Sheets("tmp").Shapes("Wykres
1").DrawingObject.Chart
For i = 1 To 7
.SeriesCollection(1).Points(i).DataLabel.Font.Colo rIndex = 0
Next i
For i = 1 To 7
If .SeriesCollection(1).Points(i).DataLabel.Text = "#N/D!" Then
.SeriesCollection(1).Points(i).DataLabel.Font.Colo rIndex = 2
End If
Next i
End With

End Sub

regards

  #4  
Old April 22nd, 2009, 03:05 PM posted to microsoft.public.excel.charting
Andy Pope
external usenet poster
 
Posts: 2,088
Default DataLabel.Font.ColorIndex vs DataLabel.Text (Private Sub does not work in excel 2003)

Hi,

The code itself works, at least in my testing. So you will have to debug
your code in your workbook.
In the VBE place your cursor on the With statement. Press F9 to add a break
point, the line should be highlighted in red.
Now when the event is triggered you will be entered into debug mode at that
line. You can then use F8 to step through each line of code.

You can see if the code loops properly and whether the IF test is applied
and passed.

is the text "#N/D!" or "#N/D"

Cheers
Andy
--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"God Itself" wrote in message
...
Hi,

i wrote code in xl07 and saved as 97-2003. i tried to open workbook in xl03
but code does not work (no effect)
"#N/D" labels are not whitened.

rgs

Użytkownik "Andy Pope" napisał w wiadomości
...
Hi,

The code works in xl03 if the workbook is saved as 97-03 compatible.
Add a break point on the first line and step through the code to see if
all
the lines are executed as expected.

Cheers
Andy
--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"God Itself" wrote in message
...
Hi,

i have sheet's code which works perfecly in Excel 2007, but nothing
happens
in excel 2003. No error occurs. what may be the cause?

Private Sub Worksheet_Calculate()'white label when value = NA()

With Workbooks("chart").Sheets("tmp").Shapes("Wykres
1").DrawingObject.Chart
For i = 1 To 7
.SeriesCollection(1).Points(i).DataLabel.Font.Colo rIndex = 0
Next i
For i = 1 To 7
If .SeriesCollection(1).Points(i).DataLabel.Text = "#N/D!" Then
.SeriesCollection(1).Points(i).DataLabel.Font.Colo rIndex = 2
End If
Next i
End With

End Sub

regards


  #5  
Old April 22nd, 2009, 03:40 PM posted to microsoft.public.excel.charting
God Itself
external usenet poster
 
Posts: 15
Default DataLabel.Font.ColorIndex vs DataLabel.Text (Private Sub does not work in excel 2003)

Ok, thanks.

thet text is "#N/D!" - this is the result of NA() function in Polish ver of excel


Użytkownik "Andy Pope" napisał w wiadomości ...
Hi,

The code itself works, at least in my testing. So you will have to debug
your code in your workbook.
In the VBE place your cursor on the With statement. Press F9 to add a break
point, the line should be highlighted in red.
Now when the event is triggered you will be entered into debug mode at that
line. You can then use F8 to step through each line of code.

You can see if the code loops properly and whether the IF test is applied
and passed.

is the text "#N/D!" or "#N/D"

Cheers
Andy


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:56 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright Š2004-2024 OfficeFrustration.
The comments are property of their posters.