Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I'm hoping this is simple one for one of you guru's. I'm looking for a macro that will search multiple columns and clear any cell that has today's date or older in it. Format of the date is 02-1-06 and 02-31-06. In other words, the day is not always two digits. -- ebraun01 ------------------------------------------------------------------------ ebraun01's Profile: http://www.excelforum.com/member.php...o&userid=30340 View this thread: http://www.excelforum.com/showthread...hreadid=513863 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hello Ebraun01, Try this macro... Sub ClearDates() Dim Cell As Range For Each Cell In ActiveSheet.UsedRange If VarType(Cell) = vbDate Then If Cell.Value <= Int(Now) Then Cell.ClearContents End If Next Cell End Sub Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=513863 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() If I have a cell that only has a date, then it works but if the cell as additional text in it, it doesnt. The macro needs to search all cells and remove any that have dates older than today. An example of a date is below. In this example I would want it to clear the cell with the Lysol Spray. Hope that is more clear and thanks for the help. Nabisco Crackers (2-26-06) Lysol Disinfectant Spray (2-1-06) Glade Spray (4-15-06) -- ebraun01 ------------------------------------------------------------------------ ebraun01's Profile: http://www.excelforum.com/member.php...o&userid=30340 View this thread: http://www.excelforum.com/showthread...hreadid=513863 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hello Ebraun01, Will the dates always be in parathesis? Will the day, month, and year always be separated by hyphens?. As long as some aspects of the format are constant, it won't be to difficult to adapt the code. Let me know. Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=513863 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Yes, thanks for the clarification. The dates are all in parenthesis and hyphens. -- ebraun01 ------------------------------------------------------------------------ ebraun01's Profile: http://www.excelforum.com/member.php...o&userid=30340 View this thread: http://www.excelforum.com/showthread...hreadid=513863 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Deleting cell data without deleting formula | Excel Discussion (Misc queries) | |||
Deleting data by sorting dates | Excel Discussion (Misc queries) | |||
Deleting time part of a Date, subtracting dates | Excel Discussion (Misc queries) | |||
Deleting dates and vlookup | Excel Discussion (Misc queries) | |||
Deleting Hyphens or Dashes from multiple cells without deleting the remaining content | Excel Programming |