Show Format Cells Dialog Box?

A

Andy

I'd like a macro to show the Format Cells dialog so I can assign it to
a hotkey (can't use the default Ctrl-1 since that's a global hotkey
for me to change desktops).

When I look at the choices for various xlDialogs, I can't find one
that will show the dialog box with all the tabs.

Application.Dialogs(xlDialogFormatNumber).Show

This only shows the Number tab. xlDialogFormatFont only shows the
font tab. The other xlDialogFormat??? choices give me an error. I
would have thought xlDialogFormatMain would have worked, but it
doesn't.

Any ideas?

TIA,

Andy
 
R

Ron de Bruin

One way is to use this

Application.CommandBars("Worksheet Menu Bar").FindControl _
(ID:=855, Recursive:=True).Execute
 
A

Andy

Thanks Ron, works perfectly!

I never could have figured this out by stumbling around in Excel's VBA
Help. Is there a list of ID numbers in there someplace?

Andy
 
A

Andy

Thank you Ron, just in time for a "weekend afternoon spend a few hours learning something
worthwhile".

Andy
 

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