ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   help with finding a concatenated string (https://www.excelbanter.com/excel-programming/390222-help-finding-concatenated-string.html)

Gary Keramidas

help with finding a concatenated string
 
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)

--


Gary




FSt1

help with finding a concatenated string
 
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
"Gary Keramidas" wrote:

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)

--


Gary





Gary Keramidas

help with finding a concatenated string
 
i ended up just breaking the find down and not trying to find it all at once.

--


Gary


"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
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)

--


Gary






Gary Keramidas

help with finding a concatenated string
 
wasn't looking to join the strings, already know that.

--


Gary


"FSt1" wrote in message
...
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
"Gary Keramidas" wrote:

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)

--


Gary








All times are GMT +1. The time now is 07:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com