Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel VBA question

Status
Not open for further replies.

tdpman

Technical User
Apr 29, 2002
44
0
0
US
OK, need a hand here. This should be a simple piece of code, I think.

I need a piece of code that will look at the contents of column H, and if it equals "00/00/00", I need it to clear the contents of column M on the same row.

Thanks!
 
sub RemoveIt
MCol = Range("M:M").Column
For Each c In Range("H1", Cells(Range("H:H").Rows.Count, Range("H:H").Column).End(xlUp).Address)
If c.Value = "00/00/00" Then
Cells(c.Row, MCol).Value = ""
End If
Next c
end

Hope it helps.
 
Hi,

Here's a way, not knowing you you are accessing a particular row...
Code:
    With ActiveCell
       If Cells(.Row, "H").Value = "00/00/00" Then
          Cells(.Row, "M").ClearContents
       End If
    End With
Hope this helps :) Skip,
metzgsk@voughtaircraft.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top