Using the Find&Replace

hartless43

New Member
Joined
Dec 28, 2022
Messages
14
Office Version
  1. 365
Platform
  1. Windows
VBA Code:
Sub FindCellThatContains()

    Columns("AO:AO").Select
    Range("AO28:AO944").Activate
    Selection.Find(What:="241", After:=ActiveCell, LookIn:=xlFormulas2, _
        LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False).Activate
End Sub


I don’t know if anyone has ever delved into something like this. The above is a VBA I created using the Marco Recorder to Find a cell with the value of 241 in Column O and it works as recorded, but without using the Find & Replace feature each time I need a way to pick up the value of cell “N1” which in this case is 241. The value of “N1” changes quite often. I tried changing the “241” to “&N1&” and that doesn’t work. The debugger doesn’t reject it. I need to change the FindWhat:=” “value to what is in cell “N1”. I am working on this experimental thing, so no big deal if no one knows.



Thanks
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
I tried to mark as solved, but don't know for sure.
You have now re-marked correctly this time.
However, just to be clear, the mark is not to show that the thread is solved, it is to mark the actual post that contains the solution. This is different to what some other forums do.
 
Upvote 0

Forum statistics

Threads
1,214,812
Messages
6,121,699
Members
449,048
Latest member
81jamesacct

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