ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel VBA - 3 Problems (Yes/no box, Password Box, Run Dialog) (https://www.excelbanter.com/excel-programming/290149-excel-vba-3-problems-yes-no-box-password-box-run-dialog.html)

Unfixing_Object

Excel VBA - 3 Problems (Yes/no box, Password Box, Run Dialog)
 
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


---
Message posted from http://www.ExcelForum.com/


R-Enemy

Excel VBA - 3 Problems (Yes/no box, Password Box, Run Dialog)
 
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.


-----Original Message-----
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


---
Message posted from http://www.ExcelForum.com/

.


Unfixing_Object[_3_]

Excel VBA - 3 Problems (Yes/no box, Password Box, Run Dialog)
 
Thankyou very much, though I still have the problem automaticall
running the dailog, any ideas

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 12:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com