Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find and Replace within workbook - from Visual basic
I need to find a string on a worksheet and change the formatting so it stands
out. That's easy. Actually, I want to find a bunch of strings on all worksheets in a workbook. I recorded a macro that does the find and replace. I selected the "options" button on the find and replace dialog box and changed the "within" to "Workbook". Did the replace and it worked great. However, the macro does NOT contain the code to change the option from Worksheet to workbook! :-( I imagine it's a one liner. Any idea what that is? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find and Replace within workbook - from Visual basic
While you were recoding the macro after you click on replace (or find) did you click on option the select 'within workbook' ? -- mpeplow ------------------------------------------------------------------------ mpeplow's Profile: http://www.excelforum.com/member.php...o&userid=34812 View this thread: http://www.excelforum.com/showthread...hreadid=551942 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find and Replace within workbook - from Visual basic
For example.....
Dim mySht As Worksheet For Each mySht In Worksheets mySht.Cells.Replace What:="Test", Replacement:="Fill", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False Next mySht HTH, Bernie MS Excel MVP "MarkS" wrote in message ... I need to find a string on a worksheet and change the formatting so it stands out. That's easy. Actually, I want to find a bunch of strings on all worksheets in a workbook. I recorded a macro that does the find and replace. I selected the "options" button on the find and replace dialog box and changed the "within" to "Workbook". Did the replace and it worked great. However, the macro does NOT contain the code to change the option from Worksheet to workbook! :-( I imagine it's a one liner. Any idea what that is? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
help for Visual Basic Find | Excel Programming | |||
Using FIND in Visual Basic | Excel Programming | |||
Where do I find help for Visual Basic for Applications Extensibili | Excel Programming | |||
Using Find/Replace in Visual basic to adapt the code | Excel Programming | |||
How to hide a workbook and to detect a hidden workbook in visual basic | Excel Programming |