Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sorry, but that is way above my head. I read up on worksheet event codes,
but I have no idea how or where to put this information. -- Self-taught "Gary''s Student" wrote: This example is for column D. If you type a month/day in a cell, it will use the year from the cell above. So if you click on D2 and type 12/25, it gets the year from D1 and applies it to D2. This is worksheet event code and should be put in the worksheet code area: Private Sub Worksheet_Change(ByVal Target As Range) Set t = Target Set d = Range("D:D") Set d1 = Range("D1") If Intersect(t, d) Is Nothing Then Exit Sub If Intersect(t, d1) Is Nothing Then If IsEmpty(t.Offset(-1, 0)) Then Exit Sub yr = Year(t.Offset(-1, 0).Value) Application.EnableEvents = False v = t.Value t.Value = DateSerial(yr, Month(v), Day(v)) Application.EnableEvents = True End If End Sub -- Gary''s Student - gsnu200787 "SydneyVada" wrote: I am entering past dates in Excel. When I enter a different month & day but same year in the next row, is there a way to do that without having to enter the year? -- Self-taught |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel not recognizing dates as dates | Excel Discussion (Misc queries) | |||
Identifying unique dates in a range of cells containing dates... | Excel Discussion (Misc queries) | |||
Identifying unique dates within a range of cells containing dates | Excel Discussion (Misc queries) | |||
need to convert list of dates to count no. of dates by week | Excel Worksheet Functions | |||
How do I get the dates on an excel chart to stay as dates instead. | Charts and Charting in Excel |