VBA - Dividing y-axis labels by 1000

RawlinsCross

Active Member
Joined
Sep 9, 2016
Messages
437
I have a macro that makes a chart based on data that is expressed in mg/L. Most of the data is in the 50,000 - 100,0000 mg/L range. When I graph this I'd like the y-labels to be scaled from 0 to 100 g/L range. How can this be done using vba?
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Upon further digging, I found the answer. All you need to do is add a comma at the end of your custom folder to divide by 1000. You get to keep all your data in its original form but the axes will be scaled - absolutely brilliant.

so instead of:
.Axes(xlValue).Select
Selection.TickLabels.NumberFormat = "#,##0.0"

you add the comma (in red):
.Axes(xlValue).Select
Selection.TickLabels.NumberFormat = "#,##0.0,"
 
Upvote 0

Forum statistics

Threads
1,214,830
Messages
6,121,839
Members
449,051
Latest member
excelquestion515

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top