Excel VBA - 3 Problems (Yes/no box, Password Box, Run Dialog)

  • Thread starter Thread starter Unfixing_Object
  • Start date Start date
U

Unfixing_Object

Hi,

I have 3 problems in my spreadsheet and I need some help creating 3
macros:

On workbook, I have a dialog, I need a macro code, to run it, because
at the moment i have to goto run dialog every time, is it possable?

I need a yes/no box for macros, when you click no then it executes
macro "X", when you click yes then macro "Y" exeutes.

Finally i need a password box, similar as above, where when the
password is right then it executes macro "Y" if it's wrong then it
executes macro "X".

Are these possable, thankyou for your time,

Aidan
 
There is the event Workbook_Open which will run as soon as
you open the file.

Here is the code for a simple message box:

Dim a As String
a = msgBox("Are you happy","Answer This",vbYesNo)
If a = vbYes then
Y
Else
X
End If

Here is the code for a simple input box:

Dim a As String
a = inputBox("Enter Password","Password")
If a = "TheCorrectPassword" Then
Y
Else
X
End If

If you want a textbox that hide the characters (****) then
you have to build a form and select the password option for
the textbox.

I hope this helps.
 
Thankyou very much, though I still have the problem automaticall
running the dailog, any ideas
 
Back
Top