LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Date and Time Picker

Hi Jeff G
I'm not sure if you got this figured out yet but if not this might work for
you.
Now I used this with a Calendar control but I think it should work for your
Date and Time Picker.
Here is my code:

Private Sub Calendar1_Click()

Range("A1").Value = Calendar1.Value

Range("A1").Offset(0, 1).Select
With Selection
ActiveCell.FormulaR1C1 = "=RC[-1]+1"
Selection.Copy
Range("C1:G1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("A2").Select

End With

With Selection
..Value = Range("A1")
..NumberFormat = "mm/dd"
..Offset(0, 1).Select
End With

ActiveCell.FormulaR1C1 = "=RC[-1]+1"
Selection.Copy
Range("C2:G2").Select
ActiveSheet.Paste
Application.CutCopyMode = False

Unload Me

End Sub


"Jeff G" wrote:

I am creating a customized timesheet for my company's owners. I have a
section which gives an overall date range that timesheet. I use a date and
time picker to pick the first date which is mm/dd/yyyy format. Then I use a
formula to automatically add six more days and report the ending date so the
overall date area looks as such: 12/26/05 to 01/01/06.

My problem arises when I go to a section of the timesheet which lists M, T,
W, R, F, Sa, Su with the abbreviated date below it such as 12/26 for M, 12/27
for T, 12/28 for W, etc.

For the date in Monday, I refer to the date from the date and time picker
cell from the top of the timesheet since it always is the Monday date for
that week. What I am having trouble with is in the fact that the format that
is used under my M is the same format as the date and time picker cell. So
instead of getting mm/dd, it inserts mm/dd/yyyy even though the format for
the cell under M states to use mm/dd.

Is there a way to override the format that is pulled from the date and time
picker cell?

Thanks,



 
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
pop up Date time picker Mike Excel Discussion (Misc queries) 3 November 17th 06 08:00 PM
Date Time Picker Mike Excel Discussion (Misc queries) 0 November 16th 06 04:36 AM
Date and Time Picker DAN J Excel Discussion (Misc queries) 2 September 21st 06 11:47 PM
date time picker chad Excel Programming 1 April 7th 04 06:27 PM
Set Value for Date/Time Picker Bill Lunney Excel Programming 1 July 21st 03 04:29 PM


All times are GMT +1. The time now is 03:10 PM.

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"