Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Default for Dates in User Form
I was just wondering if anybody could help me in making the
last date entry on an input box as the last date to show-up when a user invoke the userform. I have a pull down menu on the dates and an option for the user to type the dates. However, when the user try to change the date again after the user exit the userform, the default is not the last date the user entered. Much obliged for your help. Ligaya |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Default for Dates in User Form
Hi Ligaya
You must save the choice somewhere. An external text file, in the registry, or in a cell on a perhaps hiden sheet -here in Sheet3 A1: Private Sub UserForm_Initialize() 'dummy setup: Dim D As Date For D = Date - 15 To Date + 15 ComboBox1.AddItem D Next 'set last default: ComboBox1.Text = Sheets(3).Cells(1, 1).Value End Sub Private Sub CommandButton1_Click() 'OK button 'save this as default: Sheets(3).Cells(1, 1).NumberFormat = "@" Sheets(3).Cells(1, 1).Value = ComboBox1.Text 'rest of actions he ' -- and finally: Unload Me End Sub -- HTH. Best wishes Harald Excel MVP Followup to newsgroup only please. "Ligaya" wrote in message ... I was just wondering if anybody could help me in making the last date entry on an input box as the last date to show-up when a user invoke the userform. I have a pull down menu on the dates and an option for the user to type the dates. However, when the user try to change the date again after the user exit the userform, the default is not the last date the user entered. Much obliged for your help. Ligaya |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Default Windows Profile without default Office user info | Excel Discussion (Misc queries) | |||
How do I fill a cell in a user form from a selection on same form? | Excel Discussion (Misc queries) | |||
User form | Excel Discussion (Misc queries) | |||
User Form | Excel Discussion (Misc queries) | |||
user form | Excel Discussion (Misc queries) |