Results 1 to 3 of 3

how to convert a macro to function

Threaded View

  1. #1
    Registered User
    Join Date
    04-25-2012
    Location
    Athens
    MS-Off Ver
    Excel 2010
    Posts
    1

    how to convert a macro to function

    Hi All,

    Can anyone convert the following macro to function , in order to run for a selected column

    Thanks in advance


    Sub Greeklish()
    
    Dim keimeno As Object
    Dim pl, g, gh As Integer
    Dim gramma, myLatin  As String
    Dim V, Greek, Latin
    Set keimeno = Selection
    Greek = VBA.Array("Á", "Â", "Ã", "Ä", "Å", "Æ", "Ç", "È", "É", "Ê", "Ë", _
    "Ì", "Í", "Î", "Ï", "Ð", "Ñ", "Ó", "Ô", "Õ", "Ö", "×", "Ø", "Ù", _
    "¢", "¸", "¹", "º", "¼", "¾", "¿", "Ú", "Û", "À", "à")
    Latin = VBA.Array("A", "B", "G", "D", "E", "Z", "H", "8", "I", "K", "L", _
    "M", "N", "KS", "O", "P", "R", "S", "T", "Y", "F", "X", "PS", "W", _
    "A", "E", "H", "I", "O", "Y", "W", "I", "Y", "I", "Y")
    keimeno = UCase(keimeno)
    pl = Len(keimeno)
    ReDim V(pl - 1)
    For g = 1 To pl
    gramma = Mid(keimeno, g, 1)
        For gh = 0 To 34
        If gramma = Greek(gh) Then gramma = Latin(gh): Exit For
        Next
    V(g - 1) = gramma
    Next
    myLatin = Join(V, "")
    Selection.Value = myLatin
    End Sub
    Last edited by arlu1201; 04-17-2013 at 05:18 AM. Reason: Use code tags in future.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1