Excel Macro to Find & Replace Diacritic Characters

excel8442

New Member
Joined
Mar 18, 2016
Messages
24
I am trying the following but getting an error (on the row with --> ActiveDocument.Range.Find.Execute) in Excel 2011 for Mac. Any ideas?

Sub Diacritics_Replacement()


Dim strFind As String
Dim strReplace As String
Dim i As Long
strFind = "áéíóú"
strReplace = "aeiou"
For i = 1 To Len(strFind)
ActiveDocument.Range.Find.Execute FindText:=Mid$(strFind, i, 1), _
ReplaceWith:=Mid$(strReplace, i, 1), Replace:=wdReplaceAll
Next i


End Sub
 
Oh, Sorry but it is clear that I am wrong because I work on a windows sysem. I apologize once more.
I just read my last message again and, in case it was not clear, I work on a Windows system (Win10) and the code I posted works fine for me. You say you are using a Windows system also... I just want to check... are you still having trouble getting my code to work for you?
 
Upvote 0

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Yes, I still having trouble with this code. The result is NNNN for every cells. I am working on Win 10, too.
 
Upvote 0

Forum statistics

Threads
1,216,207
Messages
6,129,508
Members
449,512
Latest member
Wabd

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