Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to Search and Replace
I'm wondering if its possible to have a macro that will find cells wit specified text and replace it with other specified text. I have a lot of files that have these same cells that need to b modified and looking for a way to save time. Thanks -- Excel_Rooki ----------------------------------------------------------------------- Excel_Rookie's Profile: http://www.excelforum.com/member.php...fo&userid=1467 View this thread: http://www.excelforum.com/showthread.php?threadid=26287 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to Search and Replace
Hey Rookie,
If the files are all in the same folder, and are only one sheet long, then something like this will do it: Sub RunMacroOnAllFilesInFolder() With Application.FileSearch .NewSearch 'Change the folder name .LookIn = "C:\Excel" .FileType = msoFileTypeExcelWorkbooks If .Execute 0 Then For i = 1 To .FoundFiles.Count Workbooks.Open .FoundFiles(i) 'Put your recurring macro code here Cells.Replace What:="FindThis", _ Replacement:="Replacement", _ LookAt:=xlPart ActiveWorkbook.Close True Next i End If End With End Sub HTH, Bernie MS Excel MVP "Excel_Rookie" wrote in message ... I'm wondering if its possible to have a macro that will find cells with specified text and replace it with other specified text. I have a lot of files that have these same cells that need to be modified and looking for a way to save time. Thanks. -- Excel_Rookie ------------------------------------------------------------------------ Excel_Rookie's Profile: http://www.excelforum.com/member.php...o&userid=14670 View this thread: http://www.excelforum.com/showthread...hreadid=262879 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro Search and Replace | Excel Discussion (Misc queries) | |||
macro to search and replace with offset | Excel Discussion (Misc queries) | |||
SEARCH & REPLACE MACRO | Excel Programming | |||
Macro to search a column for a specific word and replace with | Excel Programming | |||
Macro search replace question | Excel Programming |