dialog box for axis minimums, maximums, and major units

J

JohnMullins

I am using the macro below to set the axis minimums, maximums, and major
units for a series of charts. I would like to tie this macro to RefEdit
controls, so that when I enter the keyboard shortcut Ctrl+Shift+A in the
active chart, a dialog box opens with three RefEdit controls in it, which I
can then use to set the MinimumScale, MaximumScale, and MajorUnit. I can get
as far as creating the dialog box in the VBE editor with the three RefEdit
controls. However, I'm clueless as to how to tie the dialog box to the
macro. Any suggestions?

(By the way, I know there is a Tushar Mehta add-in that will do the min and
max, but our computer support people are funny about add-ins, and I can't
count on them not eventually deleting it, so I'd like to do my own version)

Sub Macro20()
'
' Macro20 Macro
' Macro recorded 6/20/2007 by Mullins_J
'
' Keyboard Shortcut: Ctrl+Shift+A
'
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue)
.MinimumScale = Range("Sheet1!$D$1")
.MaximumScale = Range("Sheet1!$D$2")
.MajorUnit = Range("Sheet1!$D$3")
End With
ActiveChart.Deselect
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top