Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Insert Option Button based on value


I can't seem to get this to working right. Granted I am VERY new to VB
so I'm sure the problem is with me. Can you point me to some help file
on using VBA so I can understand what all the code does...

This is what I have done...

Alt+F11
Insert Module
Pasted in your code
Saved macro as "test"
Goto Spreadsheet and enter "1" into "A1"
(After couple seconds option buttons come up)
Change value to 2
Option Buttons stay

I need the buttons to disappear after value is no longer true...also
have other option buttons on my sheet. Is there a way to pu
everything inside this module into it's own group box so it doesn'
effect anything else.

Thank you sooo much for all the help...


E Oveson Wrote:
Here's an example. You would put something like this into the code fo
the
sheet you want this to apply to. There's no error checking o
anything.
Change "A1" to the cell you want and the value 1 to whatever you want.
Let
me know if you need any help tweaking this to your needs.

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address(False, False) = "A1" Then
If Target.Value = 1 Then

ActiveSheet.OLEObjects.Add ClassType:="Forms.OptionButton.1", _
Link:=False, DisplayAsIcon:=False, Left:=40, Top:=40, _
Width:=80, Height:=35

ActiveSheet.OLEObjects.Add ClassType:="Forms.OptionButton.1", _
Link:=False, DisplayAsIcon:=False, Left:=130, Top:=40, _
Width:=80, Height:=35

End If
End If
End Sub

[/color


--
pjw2
-----------------------------------------------------------------------
pjw23's Profile: http://www.excelforum.com/member.php...nfo&userid=631
View this thread: http://www.excelforum.com/showthread.php?threadid=27233

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
Insert comments on Option Button of Forms Toolbar Rechie Excel Discussion (Misc queries) 2 March 14th 10 11:26 AM
Insert Option Button based on value pjw23[_4_] Excel Programming 3 October 26th 04 04:03 PM
Control Cell Link for Option Button based on value in a cell arunjoshi[_14_] Excel Programming 1 May 5th 04 02:19 AM
Control Cell Link for Option Button based on value in a cell arunjoshi[_13_] Excel Programming 0 May 4th 04 05:46 AM
Combobox populating based on Option Button Todd Huttenstine[_2_] Excel Programming 7 November 9th 03 10:18 PM


All times are GMT +1. The time now is 08:09 PM.

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

About Us

"It's about Microsoft Excel"