View Single Post
 
Old 04-29-2016, 07:03 AM
kmawhood kmawhood is offline Windows 10 Office 2010 64bit
Novice
 
Join Date: Apr 2016
Posts: 2
kmawhood is on a distinguished road
Default

Thanks – I couldn't get your macro to work, but I tried looking at this again. If I can do it like this, I'm there. It's just a case of figuring out how to make this work with unicode on the line StrNew = "α,β,γ"

HTML Code:
' ConvertTable Macro
Sub ConvertTable()
Dim StrOld As String, StrNew As String
Dim RngFind As Range, RngTxt As Range, i As Long
StrOld = "a,b,c"
StrNew = "α,β,γ"
Set RngTxt = Selection.Range
For i = 0 To UBound(Split(StrOld, ","))
  Set RngFind = RngTxt.Duplicate
  With RngFind.Find
         ' Clear all previously set formatting for Find dialog box.
         .ClearFormatting
         ' Set font to Find for replacement.
         .Font.Name = "bwgrkl"
         ' Clear all previously set formatting for Replace dialog box.
         .Replacement.ClearFormatting
         ' Set font to Replace found font.
         .Replacement.Font.Name = "Arial Unicode MS"
         ' Don't find or replace any text.
         .Text = Split(StrOld, ",")(i)
         .Replacement.Text = Split(StrNew, ",")(i)
         .Format = True
         .MatchCase = True
         .MatchWholeWord = False
         .MatchWildcards = False
         .MatchSoundsLike = False
         .MatchAllWordForms = False
         .Execute Replace:=wdReplaceAll
  End With
Next
End Sub
Reply With Quote