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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search column for specific value and add date to field 2

Status
Not open for further replies.

bluegnu

Technical User
Sep 12, 2001
131
GB
I have an excel sheet where the "F" column contains order status. Where that order status is "Processed" I want to put todays date in the "G" column next to it. There may be several instances or the word Processed in the F column.

So for instance:

F4, F7 and F8 may have the word "Processed" in them. I want to press a button which runs through all the values in the values in the F column and would end up putting today's date in G4, G7 and G8.

I've tried to work this out using other examples, but I'm nowhere near.

thanks for your help.
 
A starting point (typed, untested):
For Each c In ActiveSheet.Range("F:F")
If InStr(1, c.Value, "Processed", 1) Then
c.Offset(0, 1).Value = Date
End If
Next

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
To avoid searching the massive 1048576 cells per row in Office 2007 try:

With ActiveSheet
Dim c As Range
For Each c In .Range(.Cells(1, 6), .Cells(.Rows.Count, 6).End(xlUp))
'...
Next c
End With


Cheers,
ND [smile]
 
Thanks guys, this has got me started nicely.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top