Concatenate function in vba

C

camerons

I am trying to do the following:

Sub Sample()
For a = 1 To 100
r = concatenate(Cells(a, 1), Cells(a, 2))
If r = "Mr.Jones" Then
Cells(a, 3) = ""
End If
Next a
End Sub

There is more to it, but I can't seem to use the concatenate function.
"Left", "Right" are ok, but not this one it seems. What am I missing?

Thank you
Chris Cameron
(e-mail address removed)
 
J

JE McGimpsey

One way:

Dim a As Long
For a = 1 To 100
If Cells(a, 1).Text & Cells(a, 2).Text = "Mr.Jones" Then _
Cells(a, 3).ClearContents
Next a
 
C

camerons

Thanks, I've got it working now.
What would you suggest for learning correct syntax for VBA?
 

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