Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
I would like a user to enter just the day in a cell and then display a fixed month and year. For example: user enters 25 Date display will be January 25, 2008 I have a separate worksheet for each month, so 12 worksheets that will default to corresponding month. They will all be the year 2008. Thanks for any tips. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Let's say the entries are in column A. In the worksheet event code area put
the following: Private Sub Worksheet_Change(ByVal Target As Range) Dim v As Integer Set r = Range("A:A") If Intersect(Target, r) Is Nothing Then Exit Sub v = Target.Value Application.EnableEvents = False Target.Value = DateSerial(2008, 1, v) Target.NumberFormat = "mmmm dd, yyyy" Application.EnableEvents = True End Sub This is good for the January worksheet. For the February worksheet simply replace: Target.Value = DateSerial(2008, 1, v) with Target.Value = DateSerial(2008, 2, v) REMEMBER: the worksheet code area, not a standard module. -- Gary''s Student - gsnu200752 "Tim Elhatton" wrote: Hi, I would like a user to enter just the day in a cell and then display a fixed month and year. For example: user enters 25 Date display will be January 25, 2008 I have a separate worksheet for each month, so 12 worksheets that will default to corresponding month. They will all be the year 2008. Thanks for any tips. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
If your 25 is in A1, use the formula =DATE(2008,1,A1)
-- David Biddulph "Tim Elhatton" wrote in message ... Hi, I would like a user to enter just the day in a cell and then display a fixed month and year. For example: user enters 25 Date display will be January 25, 2008 I have a separate worksheet for each month, so 12 worksheets that will default to corresponding month. They will all be the year 2008. Thanks for any tips. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sort month/date/year data using month and date only | Excel Discussion (Misc queries) | |||
trying to get day/month/year froamt while user enters year only | New Users to Excel | |||
How to use month() and day() without considering year()? | Excel Worksheet Functions | |||
How to use month() and day() without considering year()? | Excel Discussion (Misc queries) | |||
Sum by month and year | Excel Discussion (Misc queries) |