open a builtin dialog and wait for user action

E

ed

Couldnt find the needed info so far.

I have a custom form presenting options to tweak,
one of them is a text box displaying a cell's NumberFormat string and a
"CHANGE" button.
I want the button_click() to open the Format>Cell>Number pane dialog and
wait for the user interaction and validation that dialog and come back to my
Options custom form.

Any way to achieve this ?

Thanx in advance for the help.

PS:
Best i could come up with so far is

Private Sub OptionButton_Click()
Unload ConfigurationOptions
ThisWorkbook.Sheets("config").Range("signif1_format").Select
Application.SendKeys "%tc", True
End Sub

Works, but i lose the Options form
and if i add "ConfigurationOptions.Show", or anything after the .Sendkeys
line, the dialog doesn't stay open
 
E

ed

Actually i finally found a solution briefly after my post:

Private Sub ChangeButton_Click()
ThisWorkbook.Sheets("config").Range("mycell").Select
Dim X As Boolean
Do
X = Application.Dialogs(xlDialogFormatNumber).Show
Loop Until X = True
MsgBox ThisWorkbook.Sheets("config").Range("mycell").NumberFormat
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