Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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/

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Erratic Workbook Password Problems Rich Kooyer[_2_] Excel Discussion (Misc queries) 2 September 13th 07 04:46 PM
No Password Dialog JHL2 Excel Discussion (Misc queries) 1 August 8th 05 07:45 PM
how to automate opening a password protected excel file? e.g. a .xls that has a password set in the security tab. Daniel Excel Worksheet Functions 0 June 23rd 05 11:56 PM
Excel password but cant hide the sheets before entering password cakonopka[_3_] Excel Programming 1 January 30th 04 06:28 PM
Access protected VB code by initiating password dialog box WashoeJeff Excel Programming 0 January 30th 04 06:09 AM


All times are GMT +1. The time now is 11:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"