title: Password Generator formula
body: <p>I have the below code which works perfectly fine in a .xlsm file, however when I copy the code over to my Personal.xls file it no longer works. I have searched the forum and found similar threads, however none of them seem to hold the solution to my issue. </p>
  
  <p>I'm sure you can see that my code is creating a password at random (20 characters log, but I have amended the formula to show only 3 characters for the purpose of this).</p>
  
  <pre><code>Sub Password_Generator()
  
  Application.ScreenUpdating = False
  
  Sheets.Add.Name = "Password"
  
  Range("B1").Value = "A"
  Range("B2").Value = "B"
  Range("B3").Value = "C"
  Range("B4").Value = "D"
  Range("B5").Value = "E"
  Range("B6").Value = "F"
  Range("B7").Value = "G"
  Range("B8").Value = "H"
  Range("B9").Value = "I"
  Range("B10").Value = "J"
  Range("B11").Value = "K"
  Range("B12").Value = "L"
  Range("B13").Value = "M"
  Range("B14").Value = "N"
  Range("B15").Value = "O"
  Range("B16").Value = "P"
  Range("B17").Value = "Q"
  Range("B18").Value = "R"
  Range("B19").Value = "S"
  Range("B20").Value = "T"
  Range("B21").Value = "U"
  Range("B22").Value = "V"
  Range("B23").Value = "W"
  Range("B24").Value = "X"
  Range("B25").Value = "Y"
  Range("B26").Value = "Z"
  Range("B27").Value = "a"
  Range("B28").Value = "b"
  Range("B29").Value = "c"
  Range("B30").Value = "d"
  Range("B31").Value = "e"
  Range("B32").Value = "f"
  Range("B33").Value = "g"
  Range("B34").Value = "h"
  Range("B35").Value = "i"
  Range("B36").Value = "j"
  Range("B37").Value = "k"
  Range("B38").Value = "l"
  Range("B39").Value = "m"
  Range("B40").Value = "n"
  Range("B41").Value = "o"
  Range("B42").Value = "p"
  Range("B43").Value = "q"
  Range("B44").Value = "r"
  Range("B45").Value = "s"
  Range("B46").Value = "t"
  Range("B47").Value = "u"
  Range("B48").Value = "v"
  Range("B49").Value = "w"
  Range("B50").Value = "x"
  Range("B51").Value = "y"
  Range("B52").Value = "z"
  Range("B53").Value = "1"
  Range("B54").Value = "2"
  Range("B55").Value = "3"
  Range("B56").Value = "4"
  Range("B57").Value = "5"
  Range("B58").Value = "6"
  Range("B59").Value = "7"
  Range("B60").Value = "8"
  Range("B61").Value = "9"
  Range("B62").Value = "0"
  Range("B63").Value = "!"
  Range("B64").Value = "£"
  Range("B65").Value = "$"
  Range("B66").Value = "%"
  Range("B67").Value = "&amp;"
  Range("B68").Value = "*"
  
  Range("A1").Select
      ActiveCell.FormulaR1C1 = "1"
      Range("A2").Select
      ActiveCell.FormulaR1C1 = "2"
      Range("A3").Select
      ActiveCell.FormulaR1C1 = "3"
      Range("A1:A3").Select
      Selection.AutoFill Destination:=Range("A1:A68"),       Type:=xlFillDefault
      Range("A1:A68").Select
  
  Columns("A:B").Select
      Selection.EntireColumn.Hidden = True
  
  Columns("G").Select
      Selection.ColumnWidth = 35
  
  Range("G2").Value = "PASSWORD"
  Range("G4").Value = "Select F9 to generate a new password"
  
  
  Range("G3").Formula = "=VLOOKUP(RANDBETWEEN(1,68),A:B,2,0)&amp;VLOOKUP(RANDBETWEEN(1,68),A:B,2,0)&amp;VLOOKUP(RANDBETWEEN(1,68),A:B,2,0)
  
  Range("G2:G4").Select
      With Selection
          .HorizontalAlignment = xlCenter
          .VerticalAlignment = xlCenter
      End With
  
      Range("G2").Select
      Selection.Font.Bold = True
      Range("G4").Select
      Selection.Font.Italic = True
      Selection.Font.Size = 9
      Range("G3").Copy
  
  Application.ScreenUpdating = False
  
  End Sub
  </code></pre>