Macros for Copying Data of Cell even after increasing Number of rows and applying filter

tricksfire

New Member
Joined
Jul 28, 2017
Messages
2
Hey,I have a sheet of Engineers Name with allocated complaint numbers and their mobile number. i want to create a Macros script so that every time i apply filter on a particular engineer and press a Macros Created Keyboard short cut it copies engineer mobile number.

Engineer Mobile Number: Column H
Engineer Name: Column W
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Try this:

Code:
Sub Get_Phone_Number()
On Error GoTo M
Dim ans As String
ans = InputBox("Enter Name")
Dim SearchString As String
Dim SearchRange As Range
SearchString = ans
Set SearchRange = Range("W1:W" & Cells(Rows.Count, "W").End(xlUp).Row).Find(SearchString)
ansNumber = SearchRange.Offset(0, -15).Value
MsgBox ans & "  Phone # is:" & vbNewLine & ansNumber
Application.ScreenUpdating = False
Exit Sub
M:
MsgBox "No such name found." & vbNewLine & "You must enter full name" & vbNewLine & "You entered:" & vbNewLine & ans
Application.ScreenUpdating = False
End Sub
 
Upvote 0
Thanks for quick reply, I think above code works similar as CLT+F to find and move to defined cell. But what i am trying to find is completely different. As i said above,I have an Excel sheet with Engineers Name in Column W and Engineer mobile number in Column H . I Am Looking for some tricks or macros script so that if i apply filter and select a particular engineer name from the list in Column W and press a Macros Created Keyboard shortcut it copies engineer mobile number Column H.
 
Upvote 0
I thought you were wanting to look up some ones phone number.

Sorry but now I do not understand what you want.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top