Need help with a Find macro

ATavakolian

New Member
Joined
May 8, 2011
Messages
2
Hello:

I have spread sheet with 6 columns, I need a dialog box to get a user input and find it in column D once found on the same row take cell E (numeric) and increment it by 1. Loop this until user input is ""

Thanks
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Try this

Code:
Sub IncE()
Dim Found As Range, s As String
Do
    s = InputBox("Enter search value")
    If s = "" Then Exit Sub
    Set Found = Columns("D").Find(what:=s, LookIn:=xlValues, lookat:=xlWhole)
    If Found Is Nothing Then
        MsgBox "Not found", vbInformation
    Else
        With Found.Offset(, 1)
            .Value = .Value + 1
        End With
    End If
Loop
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,559
Messages
6,179,513
Members
452,921
Latest member
BBQKING

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