Updating format of axis on the basis of a calculated value in a Cell

maddison1984

New Member
Joined
Apr 15, 2015
Messages
2
Hi All,

I'm new to this so please forgive my ignorance. I am trying to format a graph axis on the basis of the data in a cell which is calculated by formula.

To do this I have created one macro (which I have tested) which I intend to reference in the worksheet_calculate() function as below:


Private Sub Worksheet_Calculate()
If [A1] > 5 Then
Application.EnableEvents = False
Call Format_YAxis_Dollars
Application.EnableEvents = True
End If
End Sub

Can anyone help with this?

Thanks,
Matt
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Hi and welcome to the Board

This worked for me:

Code:
Private Sub Worksheet_Calculate()


If [A1] > 5 Then
    Format_yaxis_dollars
    Application.EnableEvents = True
End If
End Sub


Sub Format_yaxis_dollars()
MsgBox "formatting is done here"
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,471
Messages
6,125,000
Members
449,202
Latest member
Pertotal

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