Target

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?
 
B

Barb Reinhardt

Try this. Be aware that it will do this on the "ActiveSheet".


Sub Test()
Dim aWS As Excel.Worksheet
Dim i As Long
Dim lRow As Long
Dim myCell As Excel.Range

Set aWS = ActiveSheet

lRow = aWS.Cells(aWS.Rows.Count, "F").End(xlUp).Row

For i = 2 To lRow Step 2
Set myCell = aWS.Cells(i, "F")
If Not IsEmpty(myCell) Then
myCell.Offset(0, 1).Value = "Target"
End If

Next i

End Sub
 
B

Barb Reinhardt

I see you've asked this once before. Please only ask the question once.
Otherwise, people waste their time answering a question that's already been
answered.
 
W

Workbook

Yes, I am sorry about that, it was not something that I did intentionally. I
was having problems with my connection. Whenever I posted the question I got
an error message that said it had not posted. My apologies. Thank you for
you're help. The code works.
 
W

Workbook

My apologies. I was having trouble with my connection. Whenever I posted
the message I got an error message that said it had not posted. I am sorry.
I appreciate your help.
 

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

Top