Excel Query - Matching more than variable
Closed
Kit
-
11 Jul 2012 à 15:40
TrowaD Posts 2921 Registration date Sunday 12 September 2010 Status Contributor Last seen 27 December 2022 - 17 Jul 2012 à 09:27
TrowaD Posts 2921 Registration date Sunday 12 September 2010 Status Contributor Last seen 27 December 2022 - 17 Jul 2012 à 09:27
Related:
- Excel Query - Matching more than variable
- Excel mod apk for pc - Download - Spreadsheets
- More than 1 if statement excel - Guide
- Vat calculation excel - Guide
- Kernel for excel repair - Download - Backup and recovery
- Arrow keys not working in excel - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday 12 September 2010
Status
Contributor
Last seen
27 December 2022
555
17 Jul 2012 à 09:27
17 Jul 2012 à 09:27
Hi Kit,
See if this is to your liking:
Best regards,
Trowa
See if this is to your liking:
Sub SearchAddress()
Dim fName, lName As String
Dim lRow As Integer
fName = InputBox("Please input first name.")
lName = InputBox("Please input last name.")
lRow = Range("A" & Rows.Count).End(xlUp).Row
For Each cell In Range("A1:A" & lRow)
If cell.Value = fName And cell.Offset(0, 1).Value = lName Then
MsgBox cell.Offset(0, 2).Value, vbOKOnly, "The address for " & fName & lName & " is:"
End If
Next cell
End Sub
Best regards,
Trowa