Excel Macro Find and Replace, Nested loop?

theandrewgordon

New Member
Joined
May 8, 2017
Messages
2
I have found something rather annoying with excel. Running index match to file in a table. Then the table populates lots of formulas. At the moment it has statements like:
IF(ISBLANK(B93),0 etc. but I need to expand its ability to account for every form of blank/0/"". I need to do a find and replace that says for all cells on worksheet 'main', sometimes multiple times in some cells.
sample of what I would replace with if(OR($B93=0,0<COUNTBLANK($B93)))

If isblank(*2-5char*) replace with or(*2-5char*=0,0<countblank(2-5char*))

I would think the solution would be:
Find first instance of isblank, find first following), store from end of isblank to ), write stored into formula listed above....

Thoughts? A good way to do this and loop through all instances of this?

Ps. Here's one of the reasons I would possibly need it a couple times in a cell.
=IF(OR(ISBLANK(B37),ISBLANK(B38),ISBLANK(B39)),"N",IF($B$36="Y","R"&C38&C37 ,C39&C38&C37))


Thank you for your assistance.
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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