Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 272
Default Textbox control

Brad, Try this:
Dim TB as MSForms.TextBox
Dim cnt as Long
For cnt = 0 to 9
Set TB = UserForm1.Controls("TextBox" & cnt + 1)
TB.Visible = True 'Add logic here
Next

P.S. This is untested but should get you very close. Let me know if you need
help.
--
Charles Chickering

"A good example is twice the value of good advice."


"Brad" wrote:

Very close.

The textboxes are already there, but based on the # entered, it will
determine how many of those boxes will be visible. So the loop or 'next'
statement will force the textbox to be visible (textbox2.visible = true).

Thank you for help!


"Charles Chickering" wrote:

Brad, Are you looking to do something like this?
Dim cnt As Long
Dim tb As MSForms.TextBox
For cnt = 0 To 9
Set tb = UserForm1.Controls.Add("Forms.TextBox.1", "Textbox" & cnt +
1)
tb.Top = tb.Height * cnt + 5
Next

--
Charles Chickering

"A good example is twice the value of good advice."


"Brad" wrote:

Hello, I'm creating a quote template through userforms. I have one section to
where the user will have to enter a customer number and city/state for up to
10 listings. So the user will enter a number (1 through 10) and the
appropriate number of boxes will appear. So if they enter 8, the first 8
boxes will appear. If they change their selection to 5, then only the first 5
boxes will appear. Now I know I can program a bunch of if statements to
control the boxes but that would be a lot ifs, is there a more simple way of
doing this via a loop or something? Any help and guidance is appreciated.
Thanks.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with TEXTBOX control John Cosmas Excel Programming 2 September 20th 07 04:54 AM
How to control TextBox ? Golenboy Excel Programming 2 March 27th 07 01:49 PM
How to move cursor from one textbox control to another textbox con Tom Ogilvy Excel Programming 1 September 16th 04 03:42 PM
How to move cursor from one textbox control to another textbox con KMoore007 Excel Programming 0 September 16th 04 02:47 PM
Set Focus Problem for textbox control on multipage control ExcelDeveloperSPR Excel Programming 1 July 16th 04 08:54 PM


All times are GMT +1. The time now is 06:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"