Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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/ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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/ . |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thankyou very much, though I still have the problem automaticall
running the dailog, any ideas -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Erratic Workbook Password Problems | Excel Discussion (Misc queries) | |||
No Password Dialog | Excel Discussion (Misc queries) | |||
how to automate opening a password protected excel file? e.g. a .xls that has a password set in the security tab. | Excel Worksheet Functions | |||
Excel password but cant hide the sheets before entering password | Excel Programming | |||
Access protected VB code by initiating password dialog box | Excel Programming |