Find and Replace

Carin

Board Regular
Joined
Feb 4, 2006
Messages
224
When running the macro below, it works great if the last time I used Ctrl + F and selected Entire Workbook. But if I have just worksheet selected, the macro only runs on one sheet.

How can I change the macro so it will always run throughout the workbook no matter how I have my Ctrl + F selected from a previous search?


Cells.Replace What:=":", Replacement:="", LookAt:=xlPart, SearchOrder:= _
xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
Range("A1").Select
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Sektor

Well-known Member
Joined
May 6, 2011
Messages
2,874
Office Version
  1. 365
Platform
  1. Windows
There's no argument which would let you scan whole workbook (the same problem with so-calle "3D-formulas", i.e. =SUM(Sheet1:Sheet10!A1), which would sum up cells A1 on sheet1 and all sheets through to Sheet10). In this case, you need a loop.
 
Upvote 0

Forum statistics

Threads
1,195,856
Messages
6,011,976
Members
441,661
Latest member
Pammie007

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
Top