Reference a cell in a worksheet from a userform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a userform with option buttons on it. I am trying to accomplish the
fact when a user clicks on this particular option button it will fill a
textbox with data from a cell on a worksheet. How do I do this?
 
A simple example (2 options):
Private Sub OptionButton1_Click()
TextBox1 = Sheets("Sheet1").Range("A1").Value
End Sub

Private Sub OptionButton2_Click()
TextBox1 = Sheets("Sheet1").Range("A2").Value
End Sub

You should be able to modify this idea to meet your needs.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top