Excel Query - Matching more than variable
Closed
Kit
-
Jul 11, 2012 at 03:40 PM
TrowaD
TrowaD
- Posts
- 2886
- Registration date
- Sunday September 12, 2010
- Status
- Moderator
- Last seen
- June 27, 2022
Related:
- Excel Query - Matching more than variable
- Excel name match query ✓ - Forum - Excel
- Excel partial match two columns - Guide
- Excel index match ignore blank cells ✓ - Forum - Excel
- Excel find matching values in two worksheets - Guide
- Excel vba match array - Guide
1 reply
TrowaD
Jul 17, 2012 at 09:27 AM
- Posts
- 2886
- Registration date
- Sunday September 12, 2010
- Status
- Moderator
- Last seen
- June 27, 2022
Jul 17, 2012 at 09:27 AM
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