help with finding a concatenated string

  • Thread starter Thread starter Gary Keramidas
  • Start date Start date
G

Gary Keramidas

on one sheet, i want to concatenate 3 cells, say c2,d2,e2 (strToFind)and then
search for that string on another sheet in columns b,c and d concatenated.
what is the syntax for the find?

strToFind = ws.Range("C" & irow) & ws.Range("D" & irow) & ws.Range("E" & irow)

Set rngfound = ws2.Range("B2:D" & nextrow).Find(What:=strToFind, _
LookIn:=xlValues, lookat:=xlWhole)
 
hi
Sub concat()
Dim n As String
Dim n1 As Range
Dim n2 As Range
Dim n3 As Range
Set n1 = Cells(2, 3) 'c2
Set n2 = Cells(2, 4) 'd2
Set n3 = Cells(2, 5) 'e2
n = n1 & n2 & n3
MsgBox n
'Cells(1, 1).Value = n
End Sub

regards
 

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