Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default 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
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
Default Windows Profile without default Office user info Karen Excel Discussion (Misc queries) 0 November 12th 08 04:53 PM
How do I fill a cell in a user form from a selection on same form? Terry Tipsy Excel Discussion (Misc queries) 4 June 11th 07 02:59 PM
User form JonathanW Excel Discussion (Misc queries) 1 May 2nd 07 07:50 AM
User Form Obi-Wan Kenobi Excel Discussion (Misc queries) 1 March 23rd 06 07:21 PM
user form static69 Excel Discussion (Misc queries) 1 February 6th 05 08:43 PM


All times are GMT +1. The time now is 11:15 AM.

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

About Us

"It's about Microsoft Excel"