Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Call SaveSettings
I've almost got this code the way I need it ,But.The point is not to be asked
again once you've answered the Userform and MsgBox. The problem is when I'm at the UserForm and I have a Commandbutton2 thats a "Remind me Later" when selected closes the Userform with no data but it still saves the setting and doesn't open up again untill the next year at that date. Any help at all. Thanks in Advance: L = Month(Date) * 10000 + Year(Date) M = GetSetting("Demo", "Drafts", "Month", 0) If L = M Then Exit Sub If Month(Date) = 2 Then If Day(Date) = 24 And Day(Date) < 27 Then UserForm1.Show 'Here is the problem with CommandButton2 I Think If MsgBox("Do you qualify for Bank Day?", _ vbYesNo) = vbYes Then MsgBox ("1 Day has been added to your Bank Days") Call SaveSetting("Demo", "Drafts", "Month", L) Worksheets("Vacation").Range("C3").Value = 1 Else Worksheets("Vacation").Range("C3").Value = 0 End If End If End If |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Call SaveSettings
Hi Richard,
Try this: 'Add this variable declaration Dim Ans as Variant 'this holds the response to your question To test the response, use it as follows: Ans = MsgBox("Do you qualify for Bank Day?", vbYesNo) If Ans = vbYes Then... 'do your thing If Commandbutton2 is on the userform, then the code for the message and subsequent response to the question, should be in its Click event. In the VBE, right-click Commandbutton2 on the userform and select "View Code". Use something like this to display the userform: Sub ShowMyForm() Userform1.Show End Sub Once the userform is displayed, it should handle all the code related to its use. ....hope this helps! GS |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
SaveSettings Statement - Network based application | Excel Discussion (Misc queries) | |||
I'm not sure what you'd call it, but is it possible to do this? | Excel Discussion (Misc queries) | |||
Call Center Management: How to calculate 'cost per call' | Excel Discussion (Misc queries) | |||
Run or Call | Excel Programming | |||
Getsetting and Savesettings | Excel Programming |