ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to create textbox's at a userform Initialize (https://www.excelbanter.com/excel-programming/427196-how-create-textboxs-userform-initialize.html)

Dwaine Horton[_2_]

How to create textbox's at a userform Initialize
 
I have a VBA program that has several forms. On one form are three
multiselect listboxes. I have a button that will allow the user to review
the data they selected and also see a final price. Seeing that I don't know
how many textboxes I will need I would like to create a text box in the
intialize procedure of the review form.

Any ideas on how I can accomplish this?

Paul C

How to create textbox's at a userform Initialize
 
Create the form with all of the textboxes and captions you may need.

You can then use this for the form (the code goes behind the form in VBA).

Set whatever conditions you need and show and hide boxes and captions as
needed

Private Sub UserForm_Initialize()

if (Condition to display) then
Userform.Label1.Caption = "Whatever message you need"
TextBox1.Enabled = True
TextBox1.Visible = True
else
Userform.Label1.Caption = ""
TextBox1.Enabled = False
TextBox1.Visible = False
end if
End sub

--
If this helps, please remember to click yes.


"Dwaine Horton" wrote:

I have a VBA program that has several forms. On one form are three
multiselect listboxes. I have a button that will allow the user to review
the data they selected and also see a final price. Seeing that I don't know
how many textboxes I will need I would like to create a text box in the
intialize procedure of the review form.

Any ideas on how I can accomplish this?



All times are GMT +1. The time now is 07:17 PM.

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