Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Is there a way to set up a one-time default date?

I am trying to make my template extremely user friendly. Every year I add
one or two upgrades to my companies timesheet template. This year I am going
all out and making it nearly effortless to create and fill in. The idea is
that if the redundant, brainless information is filled in for you then you
can spend more time writing descriptions for every time entry.

What I am trying to do now is to help fill in the date field. I have
already created a single pull-down with validation which will only allow for
a Monday date to be used via a list of Monday dates I entered into a 'data'
sheet. If any of you know of a better way to handle this, which will
eliminate the need for me to update this list every year, please let me know.
I don't plan to work here forever and I don't want to leave them with a
template which will eventually become obsolete if it is not maintained.

But the real meat-and-potatoes of my question is - is there a way to set a
date cell in the one-and-only time that the template is called upon to start
a new timesheet (bi-weekly)? I have set auto-date fields before only to be
disappointed when it updates every single time the file was accessed.
Ideally it should insert the closest Monday's date and allow the user to
change it (in case the timesheet is being done before or after it's given
time) via the validation drop-down I explained above.

I also plan to do a similar task which the template should auto-fill in a
user's name according to what the current user's login is.

I hope I didn't make my question more complicated than necessary.

TIA
Jeffrey K. Ries
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default Is there a way to set up a one-time default date?

Jeffrey

Spongebob wrote:
[snip]

What I am trying to do now is to help fill in the date field. I have
already created a single pull-down with validation which will only
allow for a Monday date to be used via a list of Monday dates I
entered into a 'data' sheet. If any of you know of a better way to
handle this, which will eliminate the need for me to update this list
every year, please let me know. I don't plan to work here forever and
I don't want to leave them with a template which will eventually
become obsolete if it is not maintained.


Your list of Mondays should be formulas that update when the year changes.
Test to see if the date is greater than Jan 10th. If it is, use the current
year in your Mondays formula, if not, use the previous year. See Chip's
site for formula to get Mondays

http://www.cpearson.com/excel/datetime.htm



But the real meat-and-potatoes of my question is - is there a way to
set a date cell in the one-and-only time that the template is called
upon to start a new timesheet (bi-weekly)? I have set auto-date
fields before only to be disappointed when it updates every single
time the file was accessed. Ideally it should insert the closest
Monday's date and allow the user to change it (in case the timesheet
is being done before or after it's given time) via the validation
drop-down I explained above.


You can't do it with a formula, only a macro. You could use a macro like

Private Sub workbook_open()

With Sheet1.Range("A1")
If IsEmpty(.Value) Then
.Value = Date - (Weekday(Date, vbSunday) - 2)
End If
End With

End Sub

Although that won't give you the closest Monday.


I also plan to do a similar task which the template should auto-fill
in a user's name according to what the current user's login is.


See he
http://www.dicks-blog.com/archives/2...ername-in-vba/


--
Dick Kusleika
Excel MVP
Daily Dose of Excel
www.dicks-blog.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
Default date and time in the comment. Gary Excel Worksheet Functions 4 January 16th 07 11:17 PM
HOW DO YOU SET THE DEFAULT TIME FOR DATE IN EXCEL TO 8:00 AM? David Excel Discussion (Misc queries) 4 August 31st 06 02:52 AM
How do I get the default workbook settings to print the date/time/ kuhac Excel Discussion (Misc queries) 2 July 27th 06 06:52 PM
Problem with default date/Time mward04 Excel Worksheet Functions 3 March 13th 06 04:43 PM
Calculating days & time left from start date/time to end date/time marie Excel Worksheet Functions 7 December 7th 05 02:36 PM


All times are GMT +1. The time now is 03:14 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"