View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
bollard bollard is offline
external usenet poster
 
Posts: 65
Default To delete a row automatically ocne a closing date expires.

Hi Mike

Thanks for that, but it's all a mystery to me.

Where do I type this and what is row 20?

Each row contains a vacancy whose closing date appears in column K

"Mike" wrote:

A bit complicated if your close-off dates are all over the place so I have
assumed row 20. Try this in a standard module:-

Sub deletecolumns()
Dim myrange As Range
Set myrange = Range("20:20")
Cells(20, 1).Select
For Each c In myrange
c.Select
when = c.Value
where = ActiveCell.Column
If when < Now() Then Columns(where).Select
Selection.Delete
Next
Cells(20, 1).Select
End Sub

Mike

"bollard" wrote:

Hello

I have a spreadhseet where each row has a closing date entry in one column.

Is there any way to get the sheet to compare this date with today's date and
delete the row automatically once the closing date has passed?