Excel VBA - Create Controls Dynamically in a UserForm at Runtime|Adding Multiple TextBoxes Fastly
Автор: The World Of Algorithms
Загружено: 2022-07-11
Просмотров: 9031
💡 Source Code:
Dim tb_top As Integer, btn_cnt As Integer
Private Sub CommandButton1_Click()
Dim i_val As Integer, k As Integer, nn As Byte
btn_cnt = 1
i_val = InputBox("Input value...", "", 1)
If i_val = 0 Then Exit Sub
Dim contr As Control
For k = 1 To i_val
Set contr = Me.Controls.Add("Forms.TextBox.1", "contr", -1)
nn = 0
With contr
.Left = 270
.Height = 26
.Width = 160
.Top = IIf(nn ◀ 1, tb_top + 20, tb_top)
.Font.Size = 12
.Text = "Button" & (tb_top / 30 + 1)
t_name = "Btn" & (btn_cnt + 1)
End With
nn = nn + 1
tb_top = tb_top + 30
With Me
.ScrollHeight = 30400
.ScrollBars = fmScrollBarsVertical
End With
Next k
End Sub
------------------------------------------------------------------------------------------
Buy a Cofee ☕ for theworldofalgorithms: https://ko-fi.com/theworldofalgorithms
🥰Thank you for the donation. I am deeply grateful for your help!🥰
------------------------------------------------------------------------------------------
#excelvbatutorial
#msexcel
#msexceltutorial
#msexcelcourse
#vba
#vbatutorial
#excelvba
#excelvbatutorial
#microsoftexceltutorial
#tutorial
#exceltutorial
#excelvbatutorial
#vbatutorial
#commandbutton
#excelcommandbutton
#vbacommandbutton
#textbox
#exceltextbox
#excelvbatextbox
#vbatextbox
#userform
#dynamic
#dynamically
#creaetcontrols
#createcontrolsdynamically
#runtime
#addingmultiplecontrols
#addingfastly
#programatically
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: