Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Assign Value to OptionBotton then transfer to spreadsheet

Hello all,

I need a general education on how to program an OptionButton.

I have created a userform in visual basic. It has a frame with
option buttons. One of which, specifies "Other", and has a textbox fo
user input.


What code is needed to:
1. Assign a value to each option button
2. Have the value assigned put into
ThisWorkbook.Sheets("Masterlist").Range("d2") - if the option i
selected

Please help...
Excel Nerd:confused

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Assign Value to OptionBotton then transfer to spreadsheet

Optionbuttons cannot be assigned values per se, they can only be on or off.
You could check it when pressed and set the value that way

Private Sub OptionButton1_Click()
If Me.OptionButton1.Value Then
Range("B1").Value = "Button off"
End If
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Excel Nerd " wrote in message
...
Hello all,

I need a general education on how to program an OptionButton.

I have created a userform in visual basic. It has a frame with 5
option buttons. One of which, specifies "Other", and has a textbox for
user input.


What code is needed to:
1. Assign a value to each option button
2. Have the value assigned put into -
ThisWorkbook.Sheets("Masterlist").Range("d2") - if the option is
selected

Please help...
Excel Nerd


---
Message posted from http://www.ExcelForum.com/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Transfer Spreadsheet problems Ryan Excel Discussion (Misc queries) 0 September 16th 08 03:06 PM
Transfer Spreadsheet question... NWO Excel Discussion (Misc queries) 0 June 13th 07 09:38 PM
Transfer Spreadsheet Mary Excel Worksheet Functions 0 May 9th 06 08:23 PM
Transfer text to another spreadsheet Susan New Users to Excel 12 March 23rd 06 10:06 PM
how to Assign Hyperlink to Button in Spreadsheet Warren Deeker Excel Discussion (Misc queries) 1 June 9th 05 02:05 PM


All times are GMT +1. The time now is 12:24 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"