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 Conditional Formatting, Date

I have a spreadsheet for work orders. Column A is the work order number and
Column I is the Submit Date.... I want a conditional format so that when
someone enters a work order number the date automatically fills in with the
current date. I'm sure it's a TODAY function, but I can't seem to make it
work. Can anyone help?
Thanks!

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Conditional Formatting, Date

The TODAY function will update each day you open the workbook so I don't think
that is what you want.

You need event code to enter a static date when the WO # is entered.

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Columns("B:B")) Is Nothing Then
On Error GoTo endit
Application.EnableEvents = False
If IsNumeric(Target) Then
Target.Offset(0, 1).Value = Format(Date, "dd/mm/yyyy")
End If
End If
endit:
Application.EnableEvents = True
End Sub

This is sheet event code. Right-clcik on the sheet tab and "View Code"

Copy/paste the above into that sheet module.

Alt + q to return to the Excel window.

Assumes your ID numbers are real numbers.

If not, get rid of the "If IsNumeric(Target) Then" and one of the "End If"'s


Gord Dibben MS Excel MVP


On Mon, 7 Jul 2008 15:38:18 -0700, chickalina
wrote:

I have a spreadsheet for work orders. Column A is the work order number and
Column I is the Submit Date.... I want a conditional format so that when
someone enters a work order number the date automatically fills in with the
current date. I'm sure it's a TODAY function, but I can't seem to make it
work. Can anyone help?
Thanks!


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 28
Default Conditional Formatting, Date

That worked like a charm... a tweak here and there with some of the code and
VOILA!!!!.... success!


"Gord Dibben" wrote:

The TODAY function will update each day you open the workbook so I don't think
that is what you want.

You need event code to enter a static date when the WO # is entered.

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Columns("B:B")) Is Nothing Then
On Error GoTo endit
Application.EnableEvents = False
If IsNumeric(Target) Then
Target.Offset(0, 1).Value = Format(Date, "dd/mm/yyyy")
End If
End If
endit:
Application.EnableEvents = True
End Sub

This is sheet event code. Right-clcik on the sheet tab and "View Code"

Copy/paste the above into that sheet module.

Alt + q to return to the Excel window.

Assumes your ID numbers are real numbers.

If not, get rid of the "If IsNumeric(Target) Then" and one of the "End If"'s


Gord Dibben MS Excel MVP


On Mon, 7 Jul 2008 15:38:18 -0700, chickalina
wrote:

I have a spreadsheet for work orders. Column A is the work order number and
Column I is the Submit Date.... I want a conditional format so that when
someone enters a work order number the date automatically fills in with the
current date. I'm sure it's a TODAY function, but I can't seem to make it
work. Can anyone help?
Thanks!



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Conditional Formatting, Date

Good to hear.

Thanks for the feedback.


Gord

On Tue, 8 Jul 2008 08:24:01 -0700, chickalina
wrote:

That worked like a charm... a tweak here and there with some of the code and
VOILA!!!!.... success!


"Gord Dibben" wrote:

The TODAY function will update each day you open the workbook so I don't think
that is what you want.

You need event code to enter a static date when the WO # is entered.

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Columns("B:B")) Is Nothing Then
On Error GoTo endit
Application.EnableEvents = False
If IsNumeric(Target) Then
Target.Offset(0, 1).Value = Format(Date, "dd/mm/yyyy")
End If
End If
endit:
Application.EnableEvents = True
End Sub

This is sheet event code. Right-clcik on the sheet tab and "View Code"

Copy/paste the above into that sheet module.

Alt + q to return to the Excel window.

Assumes your ID numbers are real numbers.

If not, get rid of the "If IsNumeric(Target) Then" and one of the "End If"'s


Gord Dibben MS Excel MVP


On Mon, 7 Jul 2008 15:38:18 -0700, chickalina
wrote:

I have a spreadsheet for work orders. Column A is the work order number and
Column I is the Submit Date.... I want a conditional format so that when
someone enters a work order number the date automatically fills in with the
current date. I'm sure it's a TODAY function, but I can't seem to make it
work. Can anyone help?
Thanks!




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default Conditional Formatting, Date

Hi!

you should try the NOW() function, something like this: =
+IF(A1<"",NOW(),"") where A1 is the cell where the work order number.
But I there's a disadvantage, you won't keep the date, because if you
open the workbook another day, NOW() will update to the current date,
and I don't think you want that to happen. You could copy-paste as
values at the end of the day the dates of the work orders you entered
that day. I'm sure there's a fancier way of doing this but this is
simple enough.
Regards,

Juan M
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
conditional formatting for cell date to equal today's date Sistereinstein Excel Worksheet Functions 2 September 10th 12 07:53 PM
Conditional Formatting - due date Rod from Corrections Excel Worksheet Functions 4 February 5th 07 09:39 PM
conditional formatting date Derek Excel Worksheet Functions 3 October 11th 06 06:22 PM
conditional DATE formatting? LTUser54 Excel Discussion (Misc queries) 2 May 18th 06 09:24 PM
Conditional Formatting, date. DissentChick Excel Worksheet Functions 2 July 20th 05 03:37 PM


All times are GMT +1. The time now is 04:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"