Macro To Delete Cell Contents If Date In One Cell Bigger Than Date In Another Cell

May 9, 2012

I have the following columns that return cover period dates.

Start of Cover PeriodEnd of Cover Period01-Nov-0631-Jan-0701-Jul-0831-May-0901-Dec-0930-Jun-1001-Jan-1131-Dec-10

I however need a macro that will delete the cell contents if the "Start of Cover Period" (column AK) date is > than the "End of cover period" (column AL) date.

Thus it must compare ak2 with al2 and if ak2>al2 then clear both cells. if AK2

View 2 Replies


ADVERTISEMENT

Delete Rows If Cell Contains Date Outside Date Range

May 29, 2008

I've found similar queries on the site, but none seem to handle multiple dates, and my attempts so far have been futile!

Requirement:
I press a button on Sheet1 and am prompted to enter a start date and an end date.

Depending on the dates I enter, all rows on Sheet2 which fall outside the Start/End date range will be deleted.

All dates to be checked against on Sheet2 are in a single column, and all rows are populated, there are no blanks. Dates are in the format dd/mm/yy

View 5 Replies View Related

Date Dependent Cell Contents

Jan 19, 2008

Is there any way to make a cell's contents change automatically according to the present date?

View 9 Replies View Related

Date/time Macro: Inserts The Current Date And Time In The Selected Cell Regardless Of Where That Cell Is

Oct 20, 2009

What is the code i need to use to assign a macro to a command button which inserts the current date and time in the selected cell regardless of where that cell is?

View 5 Replies View Related

Change Cell Contents (date) To A Letter?

Feb 21, 2012


I have a range B2:ZZ2000

Some of the cells contain a variety of dates (formatted as d-mmm) Other cells contain either "i", "n" or are blank - or contain a text string, eg "his name"

I'm looking macro code that will: Look at the range and only for any cell containing a date, replace it with "y".

View 1 Replies View Related

If Statement - Check Contents Of Cell To See If It Equals Date

Oct 19, 2011

I am trying and failing to write an if statement in excel (not vba) to check the contents of cell H3069 to see if it equals 29/06/2011.

I have written the following
Code:
=if(DateValue(H3069)="29/06/2011","Y","N")
which returns #Value!

View 4 Replies View Related

Excel 2010 :: Delete Cell Contents If Cell Contains Numerical Value?

Oct 8, 2013

Recently I have been practising writing my own macros in VBA. I am using Excel 2010.

I have been trying to write a macro to look at two columns in a worksheet (say, columns D and E) and to delete the contents (not the formatting, and I don't want to delete the cell itself) of that cell only if it contains a numerical value (e.g. 1, 2, 256 or any other number). If it finds a cell with letters, then it wouldn't delete the contents of the cell. The cells are currently formatted as "currency" cells.

I have been trying all sorts of things and I just can't get it to work. I can write a macro to clear a range easy enough, but I am stuck on getting it to delete the right stuff. I won't embarrass myself by uploading the code that I have been using..

View 7 Replies View Related

VBA - Display Current Date Based On Contents In Neighboring Cell / No AutoUpdate

Dec 6, 2013

I have two columns, column Q and R. Column Q has Data Validation set, where you can only choose one of four options in any given cell between rows 2-250,000. When "Complete" is chosen, the cell turns green. Now when "Complete" is chosen in column Q, I need the cell next to it in Column R to auto-fill today's date. However, the date should not update to the next day. So if the cell autofills to today's date, which is 12/6/13, tomorrow, when the date changes to 12/7/13, the cell still reads 12/6/13.

View 4 Replies View Related

Macro: Changing Cell Color Based On Date In Cell

Jan 12, 2009

I did a search on this site and found some code I was looking for (see link:

http://www.excelforum.com/excel-prog...e-in-cell.html - Leith Ross's response code).

The code works perfectly, however, if I save the workbook with a different spreadsheet on top than the spreadsheet referred to in this code, I get an error message: Method 'Range' of object '_Worksheet' failed.

I should state that I did change "Private Sub Workbook_Open()" to "Private Sub Auto_Open()".

I assume I need to modify the code but am unsure as to how.

View 11 Replies View Related

Macro To Insert Date In Cell When Text Is Inserted In Another Cell

Feb 20, 2008

I'm trying to write a macro similar to the one found here: here:http://www.techonthenet.com/excel/macros/checkbox.php.

Rather then use a textbox, I would like the cell to display the date when text is inserted in the cell to the left.

ie. I insert text (the letter 'a') in cell E11, and the date appears in cell F11.

I would also like the macro to do this for a range of cells ie. for E11 to F21, then from G11 to H21, then from I11 to J21, all the way to column IV.

View 9 Replies View Related

Add A Date Time Stamp In A Cell After Data Is Entered In A Different Cell And Date

Apr 18, 2014

I am working on an Inventory Spreadsheet. I have need it to date time stamp that willpopulate a different cell /field when text are entered in a different cell/field and will not change all the previous dates entered on the spreadsheetevery time I re-open the spreadsheet. I formula I am using is =IF(E3<>"",IF(D15="",NOW(),D15),"")and it changes each time I open thesheet to do the inventory so I do not know the date of the last inventory. Iwant to capture the actual date that the inventory was completed in thesecond/different cell?

View 9 Replies View Related

Roll On Date 11 Months In One Cell When Another Cell (date) Is Amended

Jun 5, 2009

I have had a look via search for similar but I'm not good enough to recognise whether other threads bear any relation to my query.

I have a small spreadsheet with basic conditional formatting (my level!) where we record agency staff for eleven months service to enable us to ask them to take a four week break.

I want to add a formula or similar to automatically roll the date forward eleven months when we amend the re-commencement date on their return.

E.g. we type in A1 01/01/09, B1 updates to 30/11/09

Is this possible?

View 10 Replies View Related

Excel 2010 :: Delete Row If Cell Contains Date Or Any Value

Jan 6, 2014

I came across this excellent code here on this site but it does the opposite of what I need. This code deletes empty or blank rows if the cell in column I is blank. I actually need to delete the row if the cell in column I has a date or any data. Using Excel 2010.

Sub deleteBlankRows()
On Error Resume Next
Columns("I").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End Sub

View 5 Replies View Related

Delete Cell Data Based Off Expired Date

Aug 19, 2014

I need cell A1 data deleted once the date in B1 has passed.

View 7 Replies View Related

Macro That Will Clear Contents Of Cell Based On Format Of Text In Adjacent Cell

Feb 18, 2009

Been racking brain, searching through the forum here, and my Excel 2003 Bible all day trying to figure out this problem to no avail. I would like to clear the contents of any cell in a given range if the cell immediately to the right of is formatted as bold.

View 2 Replies View Related

Adding A Date To One Cell Will Insert Close In Another Cell And Add Color To That Cell?

May 6, 2013

I would like to add a date to one cell (say A6) and have this do two things:

#1) this would add "Closed" to a given cell such a A5.

#2) and this would add a color to a group of cells like A1 through A8.

View 4 Replies View Related

Set Date In Table Cell To Be Date In Another Cell Plus 30 But Leave Blank If Other Cell Is Blank

Nov 19, 2013

I have made a table which contains 2 date columns, Both formatted as date (dd-mmm-yy), the second column is calculated as the first column, + 30, The dates work out fine when adding to a date in the first columns, but from a blank cell it displays 30-Jan-00.

e.g
Started
Finishes

12-Nov-13
12-Dec-13

30-Jan-00

09-Nov-13
09-Dec-13

11-Nov-13
11-Dec-13

Rather than delete the rows with the blanks in the Started column, is there a formula that I can use so that the cells in the "Finishes" column is left blank when the "Started" cells are blank?

The current formula for cells in the "Finished" column is:

=[@Started]+30

View 2 Replies View Related

Macro To Save File - Save Name From Cell Containing Date Using Different Date Formatting

Aug 15, 2014

I am trying to create a macro to run from a form button, within a report, to save a file to a variable file path and name depending on the date value in cell B5.

The format of B5 looks like - 13/08/2014 16:39

The file path has folders for each year in format "yyyy" with each year having sub folders for each month in format "mm".

The file name is just the date only and is formatted "dd.mm.yy" e.g. 13.08.14

I have tried the code below in various permutations but always end up with an error - Method 'SaveAs' of object '_Workbook' failed.

[Code] ......

View 3 Replies View Related

Join Cell Text And 1 Cell Date From Cell With 2 Dates

Sep 8, 2006

I have three cells in A2:C2 which require user to input some data.

What I want to achieve is to combine the data from A2:C2 in D2.

C2 is a field which user will input the date. He might key in 21/08/06 or
21/08/06, 30/08/06

I have tried using below formulas in D2 but without success.

=A2&" " &B2&" "&(C2)
=A3&" " &B3&" "&DAY(C3)&"/"&MONTH(C3)&"/"&YEAR(C3) (doesn't work if there are 2 dates.

I have attached a file which shows 3 scenarios if user input 1 date and 2 dates.

View 7 Replies View Related

DELETE CONTENTS If There Is Nothing In The Cell

Mar 14, 2008

What I need to do is starting at cell E251 of the Cheque Logging Sheet I need the code to check the cell for any contents and if there is nothing in the cell then DELETE THE CONTENTS then move to cell E250 and do the same all the way up to E2

My ACCESS problem is that even if the cells in Column E contain nothing the only way that I can upload the spreadsheet to Access is by deleting the contents of the empty cells. Currently I am doing this manually but I would rather sit back and have VBA do it for me...

View 9 Replies View Related

Formula To Delete Cell Contents After Use

Feb 28, 2007

I need a formula that would scan a given column for data, get the first available data from the first available cell ( D1 ), perform computation, input result in a different cell ( A1 ) and then delete the contents of D1 and move on the D2 and so on till end of data. So far I have been able to have the result in A1 but could not achieve the deletion of D1 contents. The purpose is to prevent the formula from scanning the data column from D1 again. In this way, the datawould be made available in one column and when the data have been processed the column would be empty and the result would be in another column.

View 2 Replies View Related

Delete Contents Of Cell If Text Is Present?

Feb 13, 2014

Need to search a sheet and find cells that contain the text "Requirement". If found then i want that cell to become blank.

example
so in sheet1,

i have a number of columns and a number of rows

in cell A3 the value is - " there are requirements"
in cell F23, the value is -"the Requirement is"

since both cells have the word requirement, I want these cells to become blank.

View 1 Replies View Related

Delete Contents Of Cell If Text Is NOT Present

Feb 19, 2014

Need to search a sheet and find cells that contain the text "."

Want all cells that don't contain a "." (dot) to be erased from the sheet

Example : so in sheet1,

I have a number of columns and a number of rows

in cell A3 the value is - " there are requirements."
in cell F23, the value is -"the Requirement is."

since both cells have "." ( dot) , I want these cells to remain in the sheet, but the rest of the cells should become blank.

View 3 Replies View Related

Delete Entire Row Depending On The Contents Of A Cell

Jan 20, 2009

I'm trying to write a procedure which will search the contents of Column B of my worksheet for the word "Total". Whenever the word "Total" is found in a cell within Column B, the entire row should be deleted.

View 5 Replies View Related

Delete Cell Contents Based On Color

Feb 14, 2008

I am using conditional formatting to apply a light green color (index number 35).
Is there a macro that can delete the cell contents of the cells with this formatting in col K and L?

View 9 Replies View Related

Move Cell Contents & Delete Rows

May 23, 2006

I have a spreadsheet with a serial number is row 1 in column A with the rest of Row 1 empty. Column A is empty in Row 2, but has the data associated with the row above in columns B through L of Row 2. Then comes 2 blank rows and the pattern repeats with a new serial number in column A of row 5 and so on. I would like to move the serial number down one row, delete the now empty first row, delete the following 2 empty rows, and then loop to do the same thing again for all 9000 rows of the spreadsheet.

View 2 Replies View Related

Delete Rows Based On Cell Contents

Aug 29, 2007

I have merged two workbooks into one. What I need to do at this point is to delete all rows that have a duplicate entry, basically anytime the cell content in one cell matches the cell content in the cell right below or above it, BOTH rows should be deleted. At this point, this is above my VBA skills so I'm asking for help in how to do this. The stripped version of the workbook is attached (only 100 rows) but in reality this is a huge workbook with almost 22,000 rows.

You will notice in the attached workbook, that cell contents for A2 and A3 match. For what I need to do, I need both rows (2 and 3) to be deleted. If you go down a bit, starting in row 89 all the contents in column A are unique so those need to remain.

View 3 Replies View Related

When Cell Date Is Changed Then Macro Should Run

Jun 25, 2014

The following code works fine but now I want it to work without a userform. SO there is no userform and so no controls.

When the user changes date in a cell then a macro should run and following kind of code should execute.

[Code] .......

View 3 Replies View Related

MACRO To Copy Date Only When Cell Value = N/A

Apr 3, 2007

I have a database where the values in col C are = to N/A for some records.

I want to replace the N/A with the value in col F of the same record, then move on to the next record, etc. etc.

View 9 Replies View Related

Delete The Contents Of Every Cell Without Deleting Any Code From My Module

Apr 16, 2009

I want to delete the contents of every cell without deleting any code from my module. The reason I ask is, I'm reading from a text file into excel.

I want to run my code to read text into excel one time through. Then i want to delete all the text, make some alterations to my code, and run the code again. That way each time the worksheet is fresh and clear before i run the code.

View 4 Replies View Related







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