Find and replace function Excel

Ammarbokhari

Board Regular
Joined
Apr 21, 2011
Messages
55
Hi everyone,
I need an excel function which can search different sheets in a workbook and replace the value of cell containing a particular value.
I can do it with Ctrl+H, but the value that I have to replace is repeated on different places in each sheet and if I go to each sheet by using find and replace it after confirming that its the same value to be replaced, the process is slow.
If i could use a function which can search each sheet particular region (the value to be replaced is present in a certain region and not in a particular cell) for the search criteria and then replace it to new value.
I have got as far as this function (=IF(E4="Excel",REPLACE(E4,1,5,"Good"),E4)) but this gives result in a different cell and not in the same cell.
There is another option =SUBSTITUTE() but that is only for text, and also not in the same cell
can anyone help!!
Thank you
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
You do realise when you press CTRL+H there is an option to search the whole workbook rather than just the active worksheet:

Click CTRL+H, then Options and then under the dropdown next to Within, change this to Workbook
 
Upvote 0
Code:
[B][FONT=Arial][SIZE=2][COLOR=#000000]Sheets("Sheet1").Select
Cells.Replace What:="Data1", Replacement:="Data2", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False

Sheets("Sheet2").Select
Cells.Replace What:="Data1", Replacement:="Data2", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False

Sheets("Sheet3").Select
Cells.Replace What:="Data1", Replacement:="Data2", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False[/COLOR][/SIZE][/FONT][/B]

just used a macro recorder real quick. messy but should get the job done
 
Upvote 0
@JackDanIce
yes I have been using this Ctrl+H for a while now, and its awesome the way it can be used to replace values within formulas. and its working across the whole workbook is also very useful for purposes similar to what I mentioned.
I am actually trying to find a function for same/similar purpose.

@jammer12001
I am totally ignorant about VBA codes.
Please can you explain what changes I need to make in order to make it work?
 
Upvote 0

Forum statistics

Threads
1,224,606
Messages
6,179,865
Members
452,948
Latest member
UsmanAli786

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