ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Axes(xlCategory).CategoryNames (https://www.excelbanter.com/excel-programming/389888-axes-xlcategory-categorynames.html)

BHatMJ

Axes(xlCategory).CategoryNames
 
I am trying to assign labels to the tickmarks on a chart in an Excel module.
I have the following code:

label = "all the same"
For Each tick In chtObj.Chart.Axes(xlCategory).CategoryNames
tick = label
Next

I am getting an error because of a type mismatch. It appears that
chtObj.Chart.Axes(xlCategory).CategoryNames is typed as "Variant/Double".

Can anyone help?

Barb Reinhardt

Axes(xlCategory).CategoryNames
 
Can you set Label to Variant/Double?

"BHatMJ" wrote:

I am trying to assign labels to the tickmarks on a chart in an Excel module.
I have the following code:

label = "all the same"
For Each tick In chtObj.Chart.Axes(xlCategory).CategoryNames
tick = label
Next

I am getting an error because of a type mismatch. It appears that
chtObj.Chart.Axes(xlCategory).CategoryNames is typed as "Variant/Double".

Can anyone help?


BHatMJ

Axes(xlCategory).CategoryNames
 
The labels are text strings so I need a way of changing CategoryNames (I
think)?

"Barb Reinhardt" wrote:

Can you set Label to Variant/Double?

"BHatMJ" wrote:

I am trying to assign labels to the tickmarks on a chart in an Excel module.
I have the following code:

label = "all the same"
For Each tick In chtObj.Chart.Axes(xlCategory).CategoryNames
tick = label
Next

I am getting an error because of a type mismatch. It appears that
chtObj.Chart.Axes(xlCategory).CategoryNames is typed as "Variant/Double".

Can anyone help?


BHatMJ

Axes(xlCategory).CategoryNames
 

Thanks for the help. I found syntax that works.
(example)
chtObj.Chart.Axes(xlCategory).CategoryNames = Range("A1:Z1")




"BHatMJ" wrote:

The labels are text strings so I need a way of changing CategoryNames (I
think)?

"Barb Reinhardt" wrote:

Can you set Label to Variant/Double?

"BHatMJ" wrote:

I am trying to assign labels to the tickmarks on a chart in an Excel module.
I have the following code:

label = "all the same"
For Each tick In chtObj.Chart.Axes(xlCategory).CategoryNames
tick = label
Next

I am getting an error because of a type mismatch. It appears that
chtObj.Chart.Axes(xlCategory).CategoryNames is typed as "Variant/Double".

Can anyone help?



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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com