Find Replace across multiple sheets from a master file

rameshvpp

New Member
Joined
Sep 22, 2013
Messages
19
Hi everybody,
i have a master file and a macro within it. japanese words and english words in columns D & E respectively
I need to find and replace the words in another workbook (all sheets it has) by drag and drop the macro to it..
pls help in this to edit drag and run
Here is the code i have...

Sub Translate()
Dim NameListWB As Workbook, thisWb As Workbook
Dim NameListWS As Worksheet, thisWs As Worksheet
Dim i As Long, lRow As Long


Application.DisplayAlerts = False
Application.EnableEvents = False
Application.ScreenUpdating = False

******* This is the workbook from where my code is running
Set thisWb = ThisWorkbook
******* The sheet count and names are infinity, so pls make changes here
Set thisWs = thisWb.Sheets("testing")


****** This is the master file
Set NameListWB = Workbooks.Open("C:Desktop\Dictionary_master.xlsm")
Set NameListWS = NameListWB.Worksheets("dictionary")


With NameListWS
lRow = .Range("D" & .Rows.Count).End(xlUp).Row


For i = 1 To lRow
thisWs.Cells.Replace What:=.Range("D" & i).Value, _
Replacement:=.Range("E" & i).Value, _
SearchOrder:=xlByColumns, _
MatchCase:=False
Next i
End With
NameListWB.Close SaveChanges:=False
Application.DisplayAlerts = True
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Have you tried the vba?
What exactly does not work?
 
Upvote 0
thanks cyrilbrd..
this code is working good in a sheet named "testing" but i need this to run on multiple sheets without giving the sheet name reference
 
Upvote 0

Forum statistics

Threads
1,214,944
Messages
6,122,391
Members
449,080
Latest member
Armadillos

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