title: VBA excel printing to printer with user form
body: <p>I have a userform, that when filled out, has a command button at the bottom. When the button is clicked, it copies the data to worksheet2, and then copies the row information into worksheet 4, which is a form, closes the userform.and opens up the welcome userform then i want it to print worksheet4.</p>
  
  <p>Here is the code I have. The print function will not work.</p>
  
  <pre><code>Private Sub SavePrintButton_Click()
  
  EditAdd
  
  Sheet4.Activate
  Dim myValue As Variant
  myValue = TextBox1.Value
  Range("b2").Value = myValue
  
  Unload Me
  
  Function PrintOneSheet()
        Sheets("Sheet4").PrintOut 
  End Function
  
  WelcomeUserForm.Show
  
  
  
  End Sub
  </code></pre>