Macro help please

T

TimmerSuds

I have two columns:

D
06/15/06
07/01/06
05/10/06
08/10/06
04/10/06

F
3
3
1
2
3

I need to be able to incorporate the following into an existing
macro...

For any cell in column F that is not equal to 3 then blank out the
corresponding cell in Column D.

For example:
If F2=3 then do nothing..
If F4=1 then blank out D4

Can this be done from within a macro?

Thanks!
 
J

jindon

Find Method

Code
-------------------

Sub test()
Dim r As Range, ff As String
Set r = Columns("f").Find(1,,,xlWhole)
If Not r Is Nothing Then
ff = r.Address
Do
r.Offset(, -1).CelarContents
Set r = Columns("f").FindNext(r)
Loop Until ff = r.Address
End If
End Su
 
J

jindon

try

Code
-------------------

Sub test()
Dim r As Range
For Eahc r In Range("f1", Range("f" & Rows.Count).End(xlUp))
If r.Value <> 3 Then r.Offset(, -1).ClearContents
Next
End Su
 
G

Gary''s Student

Sub gsnu()
For i = 1 To 65536
If Cells(i, "F").Value = 3 Then
Else
Cells(i, "D").Clear
End If
Next
End Sub
 
Top