Advertisement
Guest User

QWERTY to DVORAK macro

a guest
May 3rd, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub DVORAK()
  2.  
  3.     'converts selection to DVORAK
  4.  
  5.     Dim textRange As range
  6.     Set textRange = Selection.range
  7.    
  8.     For i = 1 To textRange.Characters.Count
  9.        
  10.         Select Case textRange.Characters(i).Text
  11.             Case "¬"
  12.                 textRange.Characters(i).Text = "~"
  13.             Case """"
  14.                 textRange.Characters(i).Text = "@"
  15.             'smart open quote
  16.            Case "“"
  17.                 textRange.Characters(i).Text = "@"
  18.             'smart close quote
  19.            Case "”"
  20.                 textRange.Characters(i).Text = "@"
  21.             Case "£"
  22.                 textRange.Characters(i).Text = "#"
  23.             Case "-"
  24.                 textRange.Characters(i).Text = "["
  25.             Case "_"
  26.                 textRange.Characters(i).Text = "{"
  27.             Case "="
  28.                 textRange.Characters(i).Text = "]"
  29.             Case "+"
  30.                 textRange.Characters(i).Text = "}"
  31.             Case "q"
  32.                 textRange.Characters(i).Text = "'"
  33.             Case "Q"
  34.                 textRange.Characters(i).Text = """"
  35.             Case "w"
  36.                 textRange.Characters(i).Text = ","
  37.             Case "W"
  38.                 textRange.Characters(i).Text = "<"
  39.             Case "e"
  40.                 textRange.Characters(i).Text = "."
  41.             Case "E"
  42.                 textRange.Characters(i).Text = ">"
  43.             Case "r"
  44.                 textRange.Characters(i).Text = "p"
  45.             Case "R"
  46.                 textRange.Characters(i).Text = "P"
  47.             Case "t"
  48.                 textRange.Characters(i).Text = "y"
  49.             Case "T"
  50.                 textRange.Characters(i).Text = "Y"
  51.             Case "y"
  52.                 textRange.Characters(i).Text = "f"
  53.             Case "Y"
  54.                 textRange.Characters(i).Text = "F"
  55.             Case "u"
  56.                 textRange.Characters(i).Text = "g"
  57.             Case "U"
  58.                 textRange.Characters(i).Text = "G"
  59.             Case "i"
  60.                 textRange.Characters(i).Text = "c"
  61.             Case "I"
  62.                 textRange.Characters(i).Text = "C"
  63.             Case "o"
  64.                 textRange.Characters(i).Text = "r"
  65.             Case "O"
  66.                 textRange.Characters(i).Text = "R"
  67.             Case "p"
  68.                 textRange.Characters(i).Text = "l"
  69.             Case "P"
  70.                 textRange.Characters(i).Text = "L"
  71.             Case "["
  72.                 textRange.Characters(i).Text = "/"
  73.             Case "{"
  74.                 textRange.Characters(i).Text = "?"
  75.             Case "]"
  76.                 textRange.Characters(i).Text = "="
  77.             Case "}"
  78.                 textRange.Characters(i).Text = "+"
  79.             Case "s"
  80.                 textRange.Characters(i).Text = "o"
  81.             Case "S"
  82.                 textRange.Characters(i).Text = "O"
  83.             Case "d"
  84.                 textRange.Characters(i).Text = "e"
  85.             Case "D"
  86.                 textRange.Characters(i).Text = "E"
  87.             Case "f"
  88.                 textRange.Characters(i).Text = "u"
  89.             Case "F"
  90.                 textRange.Characters(i).Text = "U"
  91.             Case "g"
  92.                 textRange.Characters(i).Text = "i"
  93.             Case "G"
  94.                 textRange.Characters(i).Text = "I"
  95.             Case "h"
  96.                 textRange.Characters(i).Text = "d"
  97.             Case "H"
  98.                 textRange.Characters(i).Text = "D"
  99.             Case "j"
  100.                 textRange.Characters(i).Text = "h"
  101.             Case "J"
  102.                 textRange.Characters(i).Text = "H"
  103.             Case "k"
  104.                 textRange.Characters(i).Text = "t"
  105.             Case "K"
  106.                 textRange.Characters(i).Text = "T"
  107.             Case "l"
  108.                 textRange.Characters(i).Text = "n"
  109.             Case "L"
  110.                 textRange.Characters(i).Text = "N"
  111.             Case ";"
  112.                 textRange.Characters(i).Text = "s"
  113.             Case ":"
  114.                 textRange.Characters(i).Text = "S"
  115.             Case "'"
  116.                 textRange.Characters(i).Text = "-"
  117.             'smart open quote
  118.            Case "‘"
  119.                 textRange.Characters(i).Text = "-"
  120.             'smart close quote
  121.            Case "’"
  122.                 textRange.Characters(i).Text = "-"
  123.             Case "@"
  124.                 textRange.Characters(i).Text = "_"
  125.             Case "z"
  126.                 textRange.Characters(i).Text = ";"
  127.             Case "Z"
  128.                 textRange.Characters(i).Text = ":"
  129.             Case "x"
  130.                 textRange.Characters(i).Text = "q"
  131.             Case "X"
  132.                 textRange.Characters(i).Text = "Q"
  133.             Case "c"
  134.                 textRange.Characters(i).Text = "j"
  135.             Case "C"
  136.                 textRange.Characters(i).Text = "J"
  137.             Case "v"
  138.                 textRange.Characters(i).Text = "k"
  139.             Case "V"
  140.                 textRange.Characters(i).Text = "K"
  141.             Case "b"
  142.                 textRange.Characters(i).Text = "x"
  143.             Case "B"
  144.                 textRange.Characters(i).Text = "X"
  145.             Case "n"
  146.                 textRange.Characters(i).Text = "b"
  147.             Case "N"
  148.                 textRange.Characters(i).Text = "B"
  149.             Case ","
  150.                 textRange.Characters(i).Text = "w"
  151.             Case "<"
  152.                 textRange.Characters(i).Text = "W"
  153.             Case "."
  154.                 textRange.Characters(i).Text = "v"
  155.             Case ">"
  156.                 textRange.Characters(i).Text = "V"
  157.             Case "/"
  158.                 textRange.Characters(i).Text = "z"
  159.             Case "?"
  160.                 textRange.Characters(i).Text = "Z"
  161.                
  162.         End Select
  163.        
  164.     Next i
  165.  
  166. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement