Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I have a column H which is the date a work orderis entered into the
spreadsheet. This date is automatically entered with TODAY() as soon as something is typed in the Work Order number column. I would like the Due Date column to automatically fill in with a week from the date entered (as a static date, because rushes can happen). This is the code I'm using for TODAY... Private Sub Worksheet_Change(ByVal Target As Range) If Not Application.Intersect(Target, Columns("A:A")) Is Nothing Then On Error GoTo endit Application.EnableEvents = False If IsNumeric(Target) Then Target.Offset(0, 8).Value = Format(Date, "mm/dd/yyyy") End If End If endit: Application.EnableEvents = True End Sub Could I just add to this? and how? Or does it need separate code? and what would that be? Thanks for any help! |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi
We use the current event code. You don't tell where to place due date, so I place it next to the order date. Private Sub Worksheet_Change(ByVal Target As Range) If Not Application.Intersect(Target, Columns("A:A")) Is Nothing Then 'On Error GoTo endit Application.EnableEvents = False If IsNumeric(Target) Then Target.Offset(0, 8).Value = Format(Date, "mm/dd/yyyy") DueDate = Date + Day(7) Target.Offset(0, 9).Value = DueDate End If End If endit: Application.EnableEvents = True End Sub Regards, Per "chickalina" skrev i meddelelsen ... I have a column H which is the date a work orderis entered into the spreadsheet. This date is automatically entered with TODAY() as soon as something is typed in the Work Order number column. I would like the Due Date column to automatically fill in with a week from the date entered (as a static date, because rushes can happen). This is the code I'm using for TODAY... Private Sub Worksheet_Change(ByVal Target As Range) If Not Application.Intersect(Target, Columns("A:A")) Is Nothing Then On Error GoTo endit Application.EnableEvents = False If IsNumeric(Target) Then Target.Offset(0, 8).Value = Format(Date, "mm/dd/yyyy") End If End If endit: Application.EnableEvents = True End Sub Could I just add to this? and how? Or does it need separate code? and what would that be? Thanks for any help! |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thanks so much.... works like a dream!
"Per Jessen" wrote: Hi We use the current event code. You don't tell where to place due date, so I place it next to the order date. Private Sub Worksheet_Change(ByVal Target As Range) If Not Application.Intersect(Target, Columns("A:A")) Is Nothing Then 'On Error GoTo endit Application.EnableEvents = False If IsNumeric(Target) Then Target.Offset(0, 8).Value = Format(Date, "mm/dd/yyyy") DueDate = Date + Day(7) Target.Offset(0, 9).Value = DueDate End If End If endit: Application.EnableEvents = True End Sub Regards, Per "chickalina" skrev i meddelelsen ... I have a column H which is the date a work orderis entered into the spreadsheet. This date is automatically entered with TODAY() as soon as something is typed in the Work Order number column. I would like the Due Date column to automatically fill in with a week from the date entered (as a static date, because rushes can happen). This is the code I'm using for TODAY... Private Sub Worksheet_Change(ByVal Target As Range) If Not Application.Intersect(Target, Columns("A:A")) Is Nothing Then On Error GoTo endit Application.EnableEvents = False If IsNumeric(Target) Then Target.Offset(0, 8).Value = Format(Date, "mm/dd/yyyy") End If End If endit: Application.EnableEvents = True End Sub Could I just add to this? and how? Or does it need separate code? and what would that be? Thanks for any help! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
New date based on one date field minus minutes in another field | Excel Discussion (Misc queries) | |||
largest value that can be entered into MS Excel field | Excel Discussion (Misc queries) | |||
A formula to use the greater value in a field | Excel Worksheet Functions | |||
Linked date field in worksheet defaults a blank field as 1/0/1900 | Excel Worksheet Functions | |||
How to Join/concatenate a date field with a time field in Excel? | Excel Discussion (Misc queries) |