Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Will really appreciate some help with this code for creating option buttons.
Option Explicit Dim Sht As Worksheet Dim buttonType Dim leftPos As Integer Dim topPos As Integer Dim i As Integer Sub Radio_Button_Create() Set Sht = ThisWorkbook.Worksheets(1) leftPos = 10 topPos = 10 For i = 1 To 10 buttonType = "Forms.OptionButton." & Format(i, "0") topPos = topPos + 20 Sht.Shapes.AddOLEObject _ Left:=leftPos, _ Top:=topPos, _ Width:=8, _ Height:=8, _ ClassType:=buttonType Next i End Sub It creates the first option button perfectly well but then fails on the Sht.Shapes.AddOLEObject etc with Run time error 1004. Cannot insert object. Regards, OssieMac |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Creating a form with option buttons | Excel Programming | |||
Excel: creating a group of independent option buttons | Excel Discussion (Misc queries) | |||
Navigating between option buttons is not selecting the option | Excel Programming | |||
option buttons run Click code when value is changed via VBA code | Excel Programming | |||
Creating Buttons and assigning code | Excel Programming |