Find and replace in all open Excel Workbook

Find and replace in all open Excel Workbook

Post by Sunn » Fri, 15 Jul 2011 12:53:58



Hi,

I am looking for macro where in i can do find replace in all opened excel
workbook.

Eg., I have 10 Excel workbook(s) where the Common Text is "asdfghjkl" which
i want replace with "lkjhgfdsa".

Presently I am doing this manually. Request to help me to get the macro.

Regs
Sunny

 
 
 

Find and replace in all open Excel Workbook

Post by Danie » Fri, 15 Jul 2011 21:59:55


Hello,

Try :

Sub test()

Dim Wb As Workbook, Sh As Worksheet

For Each Wb In Workbooks

    For Each Sh In Wb.Sheets

        Sh.Cells.Replace "asdfghjkl", "lkjhgfdsa"

    Next Sh

Next Wb

End Sub

Regards.

Daniel


la part de Sunny
Envoy : jeudi 14 juillet 2011 05:54

Objet : $$Excel-Macros$$ Find and replace in all open Excel Workbook

Hi,

I am looking for macro where in i can do find replace in all opened excel
workbook.

Eg., I have 10 Excel workbook(s) where the Common Text is "asdfghjkl" which
i want replace with "lkjhgfdsa".

Presently I am doing this manually. Request to help me to get the macro.

Regs

Sunny

--
----------------------------------------------------------------------------
------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links :
http://twitter.com/exceldailytip

3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com


<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel

 
 
 

Find and replace in all open Excel Workbook

Post by Sunn » Sat, 16 Jul 2011 16:27:11


Thank you Daniel.. It Worked..