Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / November 2006

Tip: Looking for answers? Try searching our database.

Forms Option control cell

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Epoh Rio - 21 Nov 2006 22:13 GMT
How can I control the value of one cell (A15) based on which option was
selected in an optionbox on a form?

Thanks,
Chip Pearson - 21 Nov 2006 22:46 GMT
You can use the Click event of each OptionButton, like the following:

Private Sub OptionButton1_Click()
   If OptionButton1.Value Then
       Range("A15").Value = 1
   End If
End Sub

Private Sub OptionButton2_Click()
   If OptionButton2.Value Then
       Range("A15").Value = 2
   End If
End Sub
Private Sub OptionButton3_Click()
   If OptionButton3.Value Then
       Range("A15").Value = 3
   End If
End Sub

Or, in a separate procedure

Select Case True
   Case OptionButton1.Value
       Range("A15").Value = 1
   Case OptionButton2.Value
       Range("A15").Value = 2
   Case OptionButton3.Value
       Range("A15").Value = 3
   Case Else
       ' no option button is selected
End Select

> How can I control the value of one cell (A15) based on which option was
> selected in an optionbox on a form?
>
> Thanks,

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.