Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This is a bit complex, so let me take a moment to explain. Im trying to
open a €˜template and connect the code to a button so a user can click it and put a €˜1 in cell Z16, then put an OptionButton in A16 and another OptionButton in B16, then assign an identifier to these OptionButtons (a name or a value to identify these objects). Then a row is inserted at row 17. Then if the user clicks the button again, a 2 goes into Z17, and an OptionButton goes into A16 and another OptionButton goes into B17, these are identified (somehow) and a row is inserted at row 18. If the user clicks the button again, a 3 goes into Z18, and . . . so on and so forth. Heres the code I have now. Private Sub CommandButton3_Click() Dim optBtn As OptionButtons Range("Z16").Select ActiveCell.Value = 1 i = 5 For i = 1 To j ActiveSheet.OptionButtons.Add ActiveCell.Offset(0, -26).Left, ActiveCell.Top, ActiveCell.Width, ActiveCell.Height ActiveSheet.OptionButtons.Add ActiveCell.Offset(0, -25).Left, ActiveCell.Top, ActiveCell.Width, ActiveCell.Height ActiveCell.Selection.EntireRow.Insert Set WS = Application.ActiveWorkbook.Worksheets("Worksheet") With Targe optBtn.Caption = "" optBtn.GroupBox.Name = strGroupName & j End With Next i End Sub What am I doing wrong? Thanks! Ryan -- Ryan--- If this information was helpful, please indicate this by clicking ''Yes''. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Create loop to insert two rows after every row of data | Excel Programming | |||
Dynamically Insert Rows | Excel Programming | |||
Dynamically setting Dimensions in a VBA loop | Excel Programming | |||
Loop with activeX optionbuttons. | Excel Programming | |||
Dynamically insert a picture. | Excel Programming |