title: Writing to a TXT file?
body: <p>So i've got a Userform on VBA, and i'm making a Dungeons &amp; Dragons style helper where you press buttons and each stat is decided for you, but i want to make it so that once you have rolled these stats, they can be saved in a text folder and opened again in the right way.</p>
  
  <p>So, i have 3 different stats. Agility, skill and strength. the code currently works like this:</p>
  
  <pre><code>Private Sub agilitybutton_Click()
  agility.Caption = Int(10 + ((Int((12 - 1 + 1) * Rnd + 1)) / (Int((4 - 1 + 1) * Rnd + 1))))
  End Sub
  
  Private Sub skillbutton_Click()
  skill.Caption = Int(10 + ((Int((12 - 1 + 1) * Rnd + 1)) / (Int((4 - 1 + 1) * Rnd + 1))))
  End Sub
  
  Private Sub strengthbutton_Click()
  strength.Caption = Int(10 + ((Int((12 - 1 + 1) * Rnd + 1)) / (Int((4 - 1 + 1) * Rnd + 1))))
  End Sub
  </code></pre>
  
  <p>So each number is a division of two random integers and it is then rounded. The first number is between 1 and 12 and the second is between 1 and 4. The first is divided by the second and shows up in a caption next to the button.</p>
  
  <p>I want to make it so that the captions of each skill. (strength.caption, skill.caption and Agility.caption) are all saved in a txt file which i can name at the push of one button.</p>
  
  <p>how do i do this?</p>