Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 28
Default Date Entered +7, unless another field is greater than 0

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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,533
Default Date Entered +7, unless another field is greater than 0

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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 28
Default Date Entered +7, unless another field is greater than 0

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
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
New date based on one date field minus minutes in another field [email protected] Excel Discussion (Misc queries) 1 December 25th 07 04:05 PM
largest value that can be entered into MS Excel field Aaron Z Excel Discussion (Misc queries) 14 October 12th 07 10:17 PM
A formula to use the greater value in a field Kelly Excel Worksheet Functions 5 November 16th 06 09:56 PM
Linked date field in worksheet defaults a blank field as 1/0/1900 AmnNkD Excel Worksheet Functions 2 September 12th 06 05:42 PM
How to Join/concatenate a date field with a time field in Excel? Alan Excel Discussion (Misc queries) 4 August 9th 05 10:07 PM


All times are GMT +1. The time now is 01:04 AM.

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"