Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I've got three columns, A, B and C. Every cell in A is populated with a date with the same month and year i.e. XX/08/2007 (dd/mm/yyyy). B and C also have dates (not necessarily in every cell). What I would like to do is empty cells in B and C that are not XX/08/2007 whether in the past or future. Any help would be appreciated. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Sub removedates() RowAMonth = Month(Range("A1")) RowAYear = Year(Range("A1")) Set BCRange = Range("B2:C20") For Each cell In BCRange If IsDate(cell) Then If (Month(cell) < RowAMonth) Or _ (Year(cell) < RowAYear) Then cell.ClearContents End If End If Next cell End Sub "SSwan" wrote: Hello, I've got three columns, A, B and C. Every cell in A is populated with a date with the same month and year i.e. XX/08/2007 (dd/mm/yyyy). B and C also have dates (not necessarily in every cell). What I would like to do is empty cells in B and C that are not XX/08/2007 whether in the past or future. Any help would be appreciated. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you Joel.
"Joel" wrote: Sub removedates() RowAMonth = Month(Range("A1")) RowAYear = Year(Range("A1")) Set BCRange = Range("B2:C20") For Each cell In BCRange If IsDate(cell) Then If (Month(cell) < RowAMonth) Or _ (Year(cell) < RowAYear) Then cell.ClearContents End If End If Next cell End Sub "SSwan" wrote: Hello, I've got three columns, A, B and C. Every cell in A is populated with a date with the same month and year i.e. XX/08/2007 (dd/mm/yyyy). B and C also have dates (not necessarily in every cell). What I would like to do is empty cells in B and C that are not XX/08/2007 whether in the past or future. Any help would be appreciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
delete cells column. Delete empty cells | Excel Worksheet Functions | |||
Delete row with empty cell in column | Excel Discussion (Misc queries) | |||
Delete Rows with Empty Cells with empty column 1 | Excel Programming | |||
delete empty column in VBA | Excel Programming | |||
delete all EMPTY cells along each COLUMN | Excel Programming |