Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default MS Calendar help requested: default to 1st of prior month

Using Calendar in a 97 UserForm to enter dates into a textbox. I want
it to default to the 1st of the previous month on opening.
I tried using the month property set to 0 and then using PreviousMonth
as the Sub but suspect that it won't change after the next month comes
around.
Made a feeble attempt at trying Today -30 just to get to any date last
month.
Any suggestions?
Thanks!
Tim
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default MS Calendar help requested: default to 1st of prior month

Calendar1.Value = DateSerial(Year(Date), Month(Date) - 1, 1)

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"timh2ofall" wrote in message
...
Using Calendar in a 97 UserForm to enter dates into a textbox. I want
it to default to the 1st of the previous month on opening.
I tried using the month property set to 0 and then using PreviousMonth
as the Sub but suspect that it won't change after the next month comes
around.
Made a feeble attempt at trying Today -30 just to get to any date last
month.
Any suggestions?
Thanks!
Tim



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
Calendar, if paid on date, not count prior Jake F Excel Worksheet Functions 2 January 13th 09 10:15 AM
15th of prior month Deb Excel Worksheet Functions 3 February 6th 07 09:48 PM
calculate prior calendar year end from a moving current date Louise Excel Worksheet Functions 1 December 6th 06 08:48 PM
dates, 1 month prior wfactor Excel Worksheet Functions 5 June 19th 06 08:23 AM
Prior Month Howard Excel Discussion (Misc queries) 6 November 2nd 05 03:06 PM


All times are GMT +1. The time now is 08:01 AM.

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"