Excel Query - Matching more than variable
Closed
Kit
-
Jul 11, 2012 at 03:40 PM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Jul 17, 2012 at 09:27 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Jul 17, 2012 at 09:27 AM
Related:
- Excel Query - Matching more than variable
- Excel mod apk for pc - Download - Spreadsheets
- Number to words in excel - Guide
- Excel marksheet - Guide
- Kernel for excel - Download - Backup and recovery
- Gif in excel - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Jul 17, 2012 at 09:27 AM
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