VBA Find Macro

Odo

New Member
Joined
Jun 18, 2010
Messages
2
I have a spreadsheet that has part number (formatted as text) in Column A, Description in Column B and Stock Count in Column C. I would like to search for the part number and have the active cell in column c waiting for the count, ask fr then next part number. Thank you
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
One method

In the worksheet module for the sheet in question use

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
RunParts
End Sub

In a standard module

Code:
Sub RunParts()
Dim MyPart As String
Dim LR As Long
Dim i As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
    MyPart = InputBox("Enter Part Number")
    If MyPart = "" Then Exit Sub
    For i = 2 To LR
        If Range("A" & i).Value = MyPart Then Range("C" & i).Activate
    Next i
End Sub

If you'd prefer this just a single macro that can also be achieved
 
Upvote 0

Forum statistics

Threads
1,215,636
Messages
6,125,961
Members
449,276
Latest member
surendra75

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