stirlingmw1
Board Regular
- Joined
- Jun 17, 2016
- Messages
- 53
- Office Version
- 2016
- 2013
- 2010
- 2007
- Platform
- Windows
Morning All
I have the following code that adds another Textbox to the Userform Frame. I am trying to add a Scrollbar to this frame that firstly appears if the added textboxes drop off the bottom of the Frame (Frame height 400) and then increase in height every time a new textbox is added thereafter. An
I have the following code that adds another Textbox to the Userform Frame. I am trying to add a Scrollbar to this frame that firstly appears if the added textboxes drop off the bottom of the Frame (Frame height 400) and then increase in height every time a new textbox is added thereafter. An
VBA Code:
Private Sub CommandButton48_Click()
Static i, o As Integer
Dim txtbox As Object
Dim lbl As Object
Set txtbox = Frame10.Controls.Add("Forms.TextBox.1")
Set lbl = Frame10.Controls.Add("forms.Label.1")
i = i + 1
With txtbox1
.Name = "checkName" & i
.Left = 30
.Height = 15.75
.Width = 60
.Top = 26 + (15.75 * i)
End With
o = 1 + o
With lbl
.Name = "checkLbl" & o
.Left = 6
.Height = 15.75
.Width = 13.5
.Top = 26 + (15.75 * o)
.Caption = 0 + o
.TextAlign = fmTextAlignCenter
End With
End Sub