Thank you once again for your help and advice. I could not have achieved what I needed without your help.
I adapted your suggestion to suit my final requirements.
The code is as follows:
Sub myFunction()
Dim lRow As Long, matchRow As Long, combinedWord As String
lRow = Worksheets("Sheet2").Cells(Rows.Count, 17).End(xlUp).
Row 'Find last used row in Col Q Sheet2
lRow = Worksheets("Sheet2").Cells(Rows.Count, 18).End(xlUp)
.Row 'Find last used row in Col R Sheet2
lRow = Worksheets("Sheet2").Cells(Rows.Count, 19).End(xlUp)
.Row 'Find last used row in Col S Sheet2
With Worksheets("Sheet2")
'After this point all object start with "." will refer to Sheet2
For i = 2 To lRow
'i is a variable for row 2 to last row
If Left(.Cells(i, 17).Value, 8) = "zVisitor" Then
'If Sheet 2-Column 17 (Q) value's left 8 character is "z"
combinedWord = Left(.Cells(i, 17).Value, 2) & Right(.Cells(i, 17).Value, 2)
'Take first and second letter from left "V", take two digits from right.
matchRow = Application.Match(combinedWord, Worksheets("Sheet1").Range("D:D"), 0)
'Get the matching row number in Sheet1 Column D with generic match function.
.Cells(i, 17).Value = Worksheets("Sheet1").Cells(matchRow, 3).Value
'Sheet2 same value will be Sheet1 Column 4 (D) matching row value
End If
If Left(.Cells(i, 18).Value, 8) = "zVisitor" Then
'If Sheet 2-Column 18 (Q) value's left 8 character is "z"
combinedWord = Left(.Cells(i, 18).Value, 2) & Right(.Cells(i, 18).Value, 2) '
Take first and second letter from left "V", take two digits from right.
matchRow = Application.Match(combinedWord, Worksheets("Sheet1").Range("D:D"), 0)
'Get the matching row number in Sheet1 Column D with generic match function.
.Cells(i, 18).Value = Worksheets("Sheet1").Cells(matchRow, 3).Value
'Sheet2 same value will be Sheet1 Column 4 (D) matching row value
End If
If Left(.Cells(i, 19).Value, 8) = "zVisitor" Then '
If Sheet 2-Column 19 (Q) value's left 8 character is "z"
combinedWord = Left(.Cells(i, 19).Value, 2) & Right(.Cells(i, 19).Value, 2)
'Take first and second letter from left "V", take two digits from right.
matchRow = Application.Match(combinedWord, Worksheets("Sheet1").Range("D:D"), 0)
'Get the matching row number in Sheet1 Column D with generic match function.
.Cells(i, 19).Value = Worksheets("Sheet1").Cells(matchRow, 3).Value
'Sheet2 same value will be Sheet1 Column 4 (D) matching row value
End If
Next
End With
End Sub
I guess there may be a way of shortening my code but it seems to work well as it is.