Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
getting textbox value
Hi
I am tryign to add dynamic textbox (I am successful...with the feedback i got from this superb usergrp). But i am unable to check for its value...i have done a lot of modification with the code below.. its gives an error at: For Each newButton In Me.Controls any help? thanks... Public newButton As MSForms.Control Private Sub UserForm_Initialize() numOfSheets = 4 z = 18 If numOfSheets 4 Then frmAddMoreSheets.Height = 300 For i = 1 To numOfSheets Set newButton = Me.Controls.Add ("Forms.Textbox.1", "txtBox") newButton.Name = "Textbox" & i z = z + 30 With newButton .Left = 18 .Top = z .Visible = True End With Next i 'Unload Me End Sub Private Sub CommandButton1_Click() For i = 1 To numOfSheets 'If TextBox & i.Value = "" Then MsgBox "emptu" Next i For Each newButton In Me.Controls With newButton If .Value = "" Then MsgBox "empty" End With Next newButton End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
getting textbox value
I resolved this...as I found a wonderful article on
dynamic forms. Though Bob had given a lead in my yesterday's post... but this one actually shows you how to refer the value's. http://pubs.logicalexpressions.com/P...PMArticle.asp? ID=259 -----Original Message----- Hi I am tryign to add dynamic textbox (I am successful...with the feedback i got from this superb usergrp). But i am unable to check for its value...i have done a lot of modification with the code below.. its gives an error at: For Each newButton In Me.Controls any help? thanks... Public newButton As MSForms.Control Private Sub UserForm_Initialize() numOfSheets = 4 z = 18 If numOfSheets 4 Then frmAddMoreSheets.Height = 300 For i = 1 To numOfSheets Set newButton = Me.Controls.Add ("Forms.Textbox.1", "txtBox") newButton.Name = "Textbox" & i z = z + 30 With newButton .Left = 18 .Top = z .Visible = True End With Next i 'Unload Me End Sub Private Sub CommandButton1_Click() For i = 1 To numOfSheets 'If TextBox & i.Value = "" Then MsgBox "emptu" Next i For Each newButton In Me.Controls With newButton If .Value = "" Then MsgBox "empty" End With Next newButton End Sub . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Calculate Textbox value based on another textbox value.doc | Excel Discussion (Misc queries) | |||
Calculate Textbox value based on another textbox value | Excel Discussion (Misc queries) | |||
Textbox to Textbox | Excel Discussion (Misc queries) | |||
TextBox | Excel Discussion (Misc queries) | |||
UserForm TextBox to ActiveSheet TextBox over 256 characters | Excel Programming |