Target Macro

  • Thread starter Thread starter Workbook
  • Start date Start date
W

Workbook

Is there a macro that will scan every even cell in column F for contents and
when it finds contents it will do this (ActiveCell.FormulaR1C1 = "Target") in
the even cell next to it in Column G?
 
Hi,

I don't really understand the question but this looks at every cell in the
used range of column F for the text 'Something" and if it finds it put Target
in column G

Sub sonic()
Dim LastRow As Long
Dim MyRange As Range
LastRow = Cells(Rows.Count, "F").End(xlUp).Row
Set MyRange = Range("F1:F" & LastRow)
For Each c In MyRange
If c.Value = "something" Then
c.Offset(, 1).Value = "Target"
End If
Next
End Sub

Mike
 
This is very good. Thank you for you're help!

Mike H said:
Hi,

I don't really understand the question but this looks at every cell in the
used range of column F for the text 'Something" and if it finds it put Target
in column G

Sub sonic()
Dim LastRow As Long
Dim MyRange As Range
LastRow = Cells(Rows.Count, "F").End(xlUp).Row
Set MyRange = Range("F1:F" & LastRow)
For Each c In MyRange
If c.Value = "something" Then
c.Offset(, 1).Value = "Target"
End If
Next
End Sub

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top