ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   adiing textbox..at runtime (https://www.excelbanter.com/excel-programming/399164-adiing-textbox-runtime.html)

Hemant_india[_2_]

adiing textbox..at runtime
 
hi there
i want to add the textboxes on my form at runtime
equal to the number ..say two as per the input
is it possible?
--
hemu

JW[_2_]

adiing textbox..at runtime
 
Private Sub UserForm_Initialize()
Dim newCtrl As Control, num As Integer
num = 2
For i = 1 To num
Set newCtrl = _
Me.Controls.Add("Forms.TextBox.1", _
"txtBox" & i, True)
newCtrl.Top = 30 * i
Next i
End Sub

Hemant_india wrote:
hi there
i want to add the textboxes on my form at runtime
equal to the number ..say two as per the input
is it possible?
--
hemu



Hemant_india[_2_]

adiing textbox..at runtime
 
million thanks JW
--
hemu


"JW" wrote:

Private Sub UserForm_Initialize()
Dim newCtrl As Control, num As Integer
num = 2
For i = 1 To num
Set newCtrl = _
Me.Controls.Add("Forms.TextBox.1", _
"txtBox" & i, True)
newCtrl.Top = 30 * i
Next i
End Sub

Hemant_india wrote:
hi there
i want to add the textboxes on my form at runtime
equal to the number ..say two as per the input
is it possible?
--
hemu





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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com