Johniny

LeadingZeroes

Mar 4th, 2020
493
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub LeadingZeroes()
  2.  
  3. Dim i As Long
  4. i = 1
  5. Dim LeadingZeroVar() As String 'zatvorky za premennou znacia array bez specifickej velkosti
  6.    Do While Not i > 11 'do akeho cisla chcem cely proces opakovat
  7.        ReDim LeadingZeroVar(i) 'array musi mat vzdy nejaku velkost, tak som daj velkost i
  8.        LeadingZeroVar(i) = Format(i, "00") 'vytvori leading zero do 2 cifier
  9.        i = i + 1
  10.     Loop
  11.  
  12. MsgBox ("Hotovo"), (vbOKOnly), ("Titulka") 'bud musim pouzit premenne alebo musia byt argumenty ozatvorkovane
  13.  
  14. End Sub
RAW Paste Data