Finding Number on Col G and put an "X" in Col M in the same ROW

Turbo68

Board Regular
Joined
Jan 31, 2014
Messages
118
I need to see if there is a way to this:

Cell A1 I can enter a 4 digit number.

Click a button to run a macro that will go to another sheet in my workbook, Look in Col G ( there are hundreds of numbers) and locate that certain number on the ROW and on that same ROW place and "X" in col M so it can be checked off so to speak.

I don't thing V lookup is the key but it seems that I think this can be done.

Thanks in advance

Mike
 
I loaded the first one that used the imputbox and worked perfect. This one did not. I dont see in the coding where it picks up my 4 dig number in cell B17 on sheet INPUT?
 
Upvote 0

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
G is just my store number listings 4 digit numbers.
I asked 4 questions and the above does not address all of them in any way. No matter as you seem to have an answer you are satisfied with, so there is no need for me to try and provide you with an alternate.
 
Upvote 0
The 4 digit number is located in cell B15 on sheet INPUT. I have named that cell STORE.
B17 or B15?

Try:
Code:
Sub M1()
    
    Dim arr()   As Variant
    Dim LR          As Long
    Dim x           As Long
    
    With Sheets("INPUT")
        LR = Application.Max(18, .Cells(.Rows.count, 2).End(xlUp).row)
        arr = .Cells(2, 17).Resize(LR - 16).Value
    End With
    
    Application.ScreenUpdating = False
    
    With Sheets("Cradlepoints")
        LR = .Cells(.Rows.count, 7).End(xlUp).row
        For x = LBound(arr, 1) To UBound(arr, 1)
            With .Cells(1, 7).Resize(LR)
                On Error Resume Next
                .find(what:=v, LookIn:=xlValues, LookAt:=xlWhole).Offset(, 6).Value = "x"
                On Error GoTo 0
            End With
        Next x
    End With
    
    Erase arr
    
End Sub
 
Last edited:
Upvote 0
Try this:
Code:
Sub My_Search()
On Error GoTo M
Dim SearchString As String
Dim SearchRange As Range
Dim Lastrow As Long
Dim ans As String
ans = Sheets("INPUT").Range("B15").Value
Lastrow = Sheets("Cradlepoints").Cells(Rows.Count, "G").End(xlUp).Row
SearchString = ans
Set SearchRange = Sheets("Cradlepoints").Range("G1:G" & Lastrow).Find(SearchString, LookIn:=xlValues, lookat:=xlWhole)
SearchRange.Offset(0, 6).Value = "X"
Exit Sub
M:
MsgBox "The value  " & ans & "  was not found"
End Sub
 
Last edited:
Upvote 0
Ahh... my brain worked. It was simple to replace the ImputBox with a location. Dhhhh.

Thanks JackDanIce
 
Upvote 0
You're welcome, though you may want to consider others that tried to help too!
 
Upvote 0
My script looks in Sheets("INPUT").Range("B15") for the search value.

But you said:
In Post 1 you said: Cell A1 I can enter a 4 digit number.
In Post 7 you said: The 4 digit number is located in cell B15 on sheet INPUT
In Post 11 you said: I dont see in the coding where it picks up my 4 dig number in cell B17

 
Upvote 0

Forum statistics

Threads
1,215,375
Messages
6,124,580
Members
449,174
Latest member
chandan4057

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