Add Todays Date When Cell Value=Y (but Not Using TODAY Formula)

Feb 17, 2009

I’ve been searching the forum but am struggling to find exactly the information I need!

I’m trying to get a column of cells to update with the date that the cells contents change to “Y”. I had been using the formula =IF(I7="Y",TODAY(),"-") in cell J7 but this updates the date every day. I need this date to remain the same as when it’s first populated.

I’ve been trying to cut and paste text from existing posts into the Visual Basic code but am new to this so am not getting the results I need. I had tried:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'will put date in column B when something is put in A
If Target.Column = 9 Then
Target.Offset(0, 1).Value = Date
End If
End Sub

But this caused all sorts of problems! I then tried messing around with:

Option Compare Text
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo enditall
Application.EnableEvents = False
If Target.Column = "I" Then
If Target.Value = "Y" Then
Excel.Range("J").Value = Date
End If
End If
enditall:
Application.EnableEvents = True
End Sub

But this doesn’t work either. In fact, both these codes are probably riddled with errors as I’ve been trying to learn by trial and error!

View 9 Replies


ADVERTISEMENT

Using VB To Find A Range Based On Todays Date And Todays Date +30

Aug 13, 2009

1 column in my sheet is a list of dates (affectively a calendar). I am trying to create a macro that will only display rows 1-5 and then current the current date and the next 30 days and hide all other rows.

The approach I have tried is to use “ADDRESS(MATCH(BS40,$B$1:$B$462,0),2)” equation to find the cell with todays date in it (Cell BS40 contains todays date). This was repeated for todays date +30. The problem I have is that although I now have the cell address’s located I cannot reference their values in a range.select

What I want to do is somwthing like this:

View 2 Replies View Related

Formula That Will Update Todays Date Not By 12am But By 6am

May 20, 2009

is it possible to have a formula that will update todays date not by 12am but by 6am.

so if i have =now() in cell b1 and my current time is 6:05 am it should give me 21-05-2009 not 20-05-2009

i am trying to get this formula in cell f1.

View 9 Replies View Related

Formula To Compare A Given Date To Todays Date

Jun 18, 2009

way to have the vehicle registration date compared to todays date and have it return either due next month, due or over due.

Todays date is in format month/day/year, registration is only by month/year. Todays date is in fixed location in worksheet updated by function Today()

Basically a formula that resembles =If(registration date < todays date, overdue, If( registration date = todays date, due, If(registration date = todays date+1month, next month, If( registration date > todays date + 1 month, 0))))

View 9 Replies View Related

If Date Cell Less Than Todays Date Calculate Difference In Days

May 13, 2008

I have column B with a heading "Days Remaining" and column L with a heading "Deadline". starting with row 5, I need to be able to enter a date in L5 and see the days I have left, from that day untill today, on B5. I need to then be able to enter a date into L6 and see a result in B6 and on and on. Then I need to be able to insert or delete a column and have the formulas still work in the columns with the heading "Days Remaining" and "Deadline"

View 7 Replies View Related

Copy Row If Cell In Column Contains Todays Date

Aug 8, 2008

I was wondering if there is any way of copying multiple, entire rows if they contain todays date from one sheet into a new one. I have a sheet (sheet1) with data such as names, reasons, and also a "next in" column, which displays the date when the person returns to work. This is column G. This sheet contains all the records ever put into the workbook. I then have a sheet (sheet2) which is for the records relevant only to 'today', it has the same layout and cell amounts as sheet1.

I'm trying to find a way to copy all of the rows from sheet1 which have 'todays' date (eg =TODAY) in their cell in column G and paste it into sheet2 to form a report of who returns to work 'today'. By 'today' I mean the day which the workbook is being used on. Ideally I'd like for the macro to be applicable to a button which can be clicked by the user, although this doesn't matter too much.

View 5 Replies View Related

Change Cell Colors Based On Todays Date/Day

May 8, 2008

I have a spreadsheet that I enter monthly expenditure on.

Column A is expenditure during 24th to 31st
Column D is expenditure during 1st to 8th
Column G is expenditure during 9th to 16th and
Column J is expenditure during 17th to 23rd

Ive been trying to colour the columns grey if todays date is outside the above date ranges each time I open the spreadsheet so its obvious which column my expenditure needs to be entered into.

View 3 Replies View Related

Excel 2003 :: Date Formula For If Given Date Is Before Or After Today Or If Nothing Entered

Jan 17, 2013

Cell B1 contains a date, then B2 contains a formula that says:

=IF(A1>TODAY(),A1,A2)

A1 contains a green tick and A2 contains a red cross.

What I am trying to add is that if B1 contains no date then B2 needs to be blank.

I tried using =IF((A1="",0),(A1>TODAY(),A1,A2) to get it to show a 0 if there was no data but this doesn't work.

I am using Excel 2003.

View 4 Replies View Related

Formula To Give Next Monday Date From Today Date

Apr 16, 2014

I have a formula

=AL260-WEEKDAY(AL260,2)+MATCH(AP260,{"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"},0)

The formula looks at the chosen start date (AL260), and then uses a displayed text day (AP20) to display the relvent date to the text day, this works fine however if the start date is say 08/08/14 (a Friday) when the formula detects a Monday (this copies down a range looking at the start date and the text days to produce dates on each line, the formula displays the Monday dates prior to start date, is there any way to alter this to make it display the dates ahead of the chosen start date?

View 10 Replies View Related

Using Today's Date In A Formula

Mar 31, 2009

this is my first post and i was a little unsure as to whether to put this in the General or VB/Macros forum, because it kind of involves both.

i'm trying to write a macro that inserts a formula that uses the date of the day that it was run (that is, i don't want it to be volatile like TODAY() and NOW(), but i don't want to have to manually type in the date into each formula).

is there a way that i can write a formula that uses the date of the day it is entered into the cell, or write a macro that adds today's date (perhaps using ActiveCell.Value = Date) and then writes a formula around that?

View 9 Replies View Related

Formula To Find Date Closest To Today?

Apr 9, 2014

I cells B5:B15 I have a list of dates from last year. I need a formula that I can put in cell D5 that gives me the date that is closest to the same day last year.

Example:

If today is 4/9/14

and

From B5:B15 there were the following dates:
3/12/13
3/19/13
3/29/13
4/5/13
4/8/13
4/12/13
5/6/13
5/29/13

Cell D5 would contain

4/8/13 since it is the date closet to same day last year.

View 4 Replies View Related

Count Formula Linked To Today Date

Feb 10, 2013

Essentially I have three columns.

Column 1 is the name of a property
Column 2 either says "Primary" or "Secondary"
Column 3 has a date of when some building work is due to be completed.

I need a formula that can tell me how many entries there are in the second column of "primary" sites that have a completion date that is less than the current date.

View 3 Replies View Related

Array Formula - The Earliest Date After Today

Jan 16, 2008

I tried searching through the forums, but I don't exactly know how to word my question!

I have a workbook with two sheets: Meetings and MasterStatus

On the both sheets I have taskID for a specific task.

On the MasterStatus sheet, I want to use an array to look up the next meeting date for each taskID (Column C), referencing the Meetings sheet (Column E) to do so.

The formula I have so far doesn't work:

=MIN(
IF(
AND(
Meetings!$A$2:$A$3000>TODAY()-1,
NOT(ISBLANK(Meetings!$A$2:$A$3000)),
Meetings!$E$2:$E$3000=$C$7),
Meetings!$A$2:$A$3000,
0
)
)

View 9 Replies View Related

Calculate The Number Of Days From A Date Entered Into Cell A1 To Today's Date

May 19, 2009

I need a formula that will calculate the number of days from a date entered into cell A1 to today's date. Whether it's before or after todays date. Example:

5/10/2009 to today is -9

5/22/2009 to today is 3

View 2 Replies View Related

Stamp Cell With Today Date Without The Date Changing Tomorrow?

Feb 7, 2013

If a1,a21,a41 have a value greater than 0, I wish to stamp cell b1,b21,b41 and so on with todays date, but without the stamped value changing/advancing tomorrow. At the moment cells b1,b21,b41 are copied down as follows. =if(a1>0,TODAY(),"") This works fine, but the date stamp of course changes tomorrow. I can not apply code to the whole b column as cells b2:b20, b22:40 etc have other non-date format data to which the code does not need to apply - the todays date value cell occurs every 20 cells.

View 6 Replies View Related

Jump To Today Date - Formula / Macro / ActiveX Or Hyperlink

Jan 21, 2014

I have a large spreadsheet with a long date range from A:3 to A:900

what would be the best way to jump to today's date? I have seen formulas, Macro's, Active X controls, Hyperlinks?

View 9 Replies View Related

Highlight A Cell If The Date In It Is Before Today's Date

Jan 8, 2009

how I can create a formula that would highlight the cell in a colour if the date was past todays date? This is what I'm doing - I have the expiry date of people's insurances. so e.g todays date is 8 th January, so if the insurance had expired 31.12.08, i would want the cell to be highlighted red. I think it may be an IF function but I cant remember.

View 3 Replies View Related

VBA Comparing Date In Cell To Today's Date

May 12, 2009

I need to VBA code that will loop through the active sheet for all rows, column C2 through however many rows there are. Col C contains a date in the format: mm/dd/yyyy. I need the VBA to compare this date to today's date+30 days and if the date in C2, etc. is greater than today's date + 30 days, shade the row a particular background color (e.g., 3).

View 9 Replies View Related

Check Date Cell Is Today's Date

Jan 23, 2008

How to check cell from a " DATE" column has todays date or not?

View 9 Replies View Related

How To Indicate Todays Date

Feb 19, 2009

I have a a planner made using excel. Monday to Sunday are from G3 - M3 and the months are in F3 going downwards. The months are abbreviated to 3 letters e.g. Jan, Feb, etc.

Where months cross over in the same week this is indicated as month/Next month e.g. Jan/Feb. Within these fields I have manually entered the dates, so for example todays date of 19th Feb is located on cell J11, (the coordinates of Thu (in J3) and the month of Feb (F11) (showing on week 8). To indicate todays data on the planner I have used an autoshape and simply filled the colour red, so that it stands out. However, when I open the planner the next day I have to move the autoshape to indicate the correct date.

The problem is, if I want to open the planner today, next week or next month (or whatever date in the current year) could a macro be devised that will indicate the correct day (i.e. by increasing the text size, change the font, color, etc?) using the exact headings as I have mentioned? I am assuming a macro on open would work which would look at todays date, and convert this to both a day in the week and month. Once done it could then find the exact day?

View 9 Replies View Related

String And Today Date In The Same Cell

Mar 21, 2014

I'm looking to combine today's date and a string in the same cell. This is what i've come up with:

The problem is that this gives today's date in a numerical value rather than in "short date" form like I want. If i format the cell as a date it doesn't change anything.

Whatever the method, for what I'm doing it has to take place in on single cell.

View 4 Replies View Related

Color Cell Containing Today's Date

Aug 1, 2008

Upon opening a spreadsheet, I would like a macro to highlight the cell which contains todays date. This will be selected from a range of dates which are already populated in column B. Is it possible to have a macro which can select the cell in column B which contains today's date? If possible, please could you include the code for doing this upon opening the spreadsheet. I'm not too confident about that either!

View 4 Replies View Related

SumIF A Date Is With In 90 Days Of Todays Date Before Or After

Oct 29, 2009

I have todays date in cell A2. I have a range of dates in a row 4 and numbers below each date in row 6. What i want is to Sum the numbers below the dates in row 6 if the date in row 4 is with in 90 days before or after the date in cell A2.

Example......

The answer i should get is 4 since only 3 dates fall 90 days before or after todays date.

View 3 Replies View Related

Vb, Form Calendar Date - Set To Todays Date

Apr 21, 2009

Im designed a form in excel, which has a calendar date picker to select a desired delivery date for the user, which makes it easier to use for the user, than using a text box.

Ive searched a number of websites and so far havent seen what I need.

I want the calendar, once my form has been opened, to automatically change to the current date.

So in summary, the code, I believe would look something like this:

View 9 Replies View Related

Fill Date Series To Todays Date Using VBA

Aug 26, 2013

I am trying to write a simple code that will take the last date in Col A and fill down until it gets to todays date.

Code:
Sub Fill_down_date()
Dim x As Integer
lr2 = Worksheets("sheet2").Cells(Rows.Count, "A").End(xlUp).Row
For x = lr2 To 20
If Cells(x, 1).Value < Date Then
Cells(x + 1, 1).Value = Cells(x, 1).Value + 1
If Cells(x, 1).Value

View 6 Replies View Related

Input Box Not Todays Date

Dec 16, 2008

I have the below code that when the spreadsheet opens input boxes pop up. The first asking to put the date in, but how can i make sure that the user does not put "todays date" in at anytime! (the date put into the inputbox (cell d2) should always be less than the date in b2 = todays date). As cell b2 in the sheet "97008390" already has todays date in. (using =today()).

View 4 Replies View Related

Save As With Todays Date As Name

Sep 11, 2006

i would like to be able to save my new workbook as "SL" with todays date next to it. so if i run my macro today it would save as SL 11/09 if i run it tommorow it would be SL 12/09

View 2 Replies View Related

If Condition For Todays Date

Aug 8, 2007

i have in a

sheet1: those field below-->
STATUS DATE
ok8-Aug-07
ok8-Aug-07
ko8-Aug-07
ko8-Aug-07
ko8-Aug-07
ok8-Aug-07
ok8-Aug-07

i have to do some calculation in another sheet2:
if date = today count the number of ok else count the number of KO

View 9 Replies View Related

Set DTpicker To Todays Date

Dec 17, 2007

My datepicker automatically defaults to the date when it was first set up. I would like it to always show the current date when the user form is first opened...

View 6 Replies View Related

Check If Each Cell Has A Date Greater Than TODAY

Nov 3, 2008

I've got the following function that check if each cell has a date greater than TODAY(). If result is true, it'll display "NO GO". Otherwise, it'll display "GO".

I would want to improve on it such that if any of the 'B5:F5' cell is empty, it'll display "Incomplete" instead of "No Go".

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved