Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Incremental dates based upon specifications

I'm trying to auto input the date of a column based off a text entry from
another column. I have used the NOW() function as my date but when you use
that formula on the line below, when one updates, they both update & I don't
want that to happen each time a new text is entered. I want the date that is
automatically entered as date with current time so that I can use that
information to validate the correct date if entered before 12, date entered
would be current date & if after 12pm it would be the next day and if entered
on friday after 12 it would be entered as monday.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default Incremental dates based upon specifications

What you described can't be done with just formulas, as it requires a
calculation to be performed at a single point in time. However, you can do
this with some visual basic coding. Right click on the sheet tab, view code,
and paste the following in, editting as required:


Private Sub Worksheet_Change(ByVal Target As Range)

'Use this line to control what range you want to check
If Intersect(Target, Range("A2:A100")) Is Nothing Or _
Target.Count 1 Then Exit Sub

'Determine current time
x = Time
If x TimeValue("12:00 pm") Then

'If in the afternoon:
If Target.Value = Date + 1 Then Exit Sub
'If in the morning
Else: If Target.Value = Date Then Exit Sub
End If

'What to say if invalid date
MsgBox "Invalid date input"
Target.Select

'Do you want entry deleted?
'If yes, remove single quotation from
'the next line

'Target.ClearContents
End Sub
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"itybitty68" wrote:

I'm trying to auto input the date of a column based off a text entry from
another column. I have used the NOW() function as my date but when you use
that formula on the line below, when one updates, they both update & I don't
want that to happen each time a new text is entered. I want the date that is
automatically entered as date with current time so that I can use that
information to validate the correct date if entered before 12, date entered
would be current date & if after 12pm it would be the next day and if entered
on friday after 12 it would be entered as monday.

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
Format a cell based on incremental numbers MurrayBarn Excel Worksheet Functions 3 June 23rd 09 02:22 PM
incremental counting based on criteria style0 Excel Discussion (Misc queries) 4 March 29th 09 04:16 AM
Incremental time values based upon clock in and clock out times saltnsnails Excel Discussion (Misc queries) 8 January 13th 09 08:11 PM
How to increase colums specifications? Consulting guy Setting up and Configuration of Excel 3 November 13th 05 04:21 AM
chart based on incremental difference robhargreaves Charts and Charting in Excel 3 July 24th 05 04:27 PM


All times are GMT +1. The time now is 06:50 PM.

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"