ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Textbox Problem (https://www.excelbanter.com/excel-programming/358913-textbox-problem.html)

toocold[_21_]

Textbox Problem
 

Good afternoon everyone,

Quick question. I have a userform that has several textboxes. When
am in Visual Basic and using the properties window, I can change th
SpecialEffect property. i.e. sunken, flat, etc.

What I am wondering is can I change this property using VBA for th
textbox?

Any ideas are appreciated.
Thanks,
d

--
toocol
-----------------------------------------------------------------------
toocold's Profile: http://www.excelforum.com/member.php...fo&userid=3160
View this thread: http://www.excelforum.com/showthread.php?threadid=53299


Bob Phillips[_6_]

Textbox Problem
 
With Me.TextBox1
.SpecialEffect = fmSpecialEffectSunken
End With


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"toocold" wrote in
message ...

Good afternoon everyone,

Quick question. I have a userform that has several textboxes. When I
am in Visual Basic and using the properties window, I can change the
SpecialEffect property. i.e. sunken, flat, etc.

What I am wondering is can I change this property using VBA for the
textbox?

Any ideas are appreciated.
Thanks,
dw


--
toocold
------------------------------------------------------------------------
toocold's Profile:

http://www.excelforum.com/member.php...o&userid=31608
View this thread: http://www.excelforum.com/showthread...hreadid=532998




toocold[_22_]

Textbox Problem
 

Thanks Bob, exactly what I was looking for.

One more question.

I have a series of textboxes. Textbox1 through Textbox12. For eac
textbox, I want to test something to see if it is true. I am going t
use a if then statement. But what I was wondering is can a perso
somehow identify the textbox using a variable. I don't want to hav
the same code repeated for each textbox.

ie. Could I somehow do something like

Dim xcount as integer

xcount = 12

Do while xcount 0

'unspecified code if statement
textbox(xcount).value = something.

loop

Just curious. This would help me simplify the work greatly. An
ideas?
Cheers,
d

--
toocol
-----------------------------------------------------------------------
toocold's Profile: http://www.excelforum.com/member.php...fo&userid=3160
View this thread: http://www.excelforum.com/showthread.php?threadid=53299


Bob Phillips[_6_]

Textbox Problem
 
Dim ctl As Control
For Each ctl In Me.Controls
If TypeName(ctl) = "TextBox" Then
MsgBox ctl.Name
End If
Next ctl

is one way of getting at all textboxes in a loop

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"toocold" wrote in
message ...

Thanks Bob, exactly what I was looking for.

One more question.

I have a series of textboxes. Textbox1 through Textbox12. For each
textbox, I want to test something to see if it is true. I am going to
use a if then statement. But what I was wondering is can a person
somehow identify the textbox using a variable. I don't want to have
the same code repeated for each textbox.

ie. Could I somehow do something like

Dim xcount as integer

xcount = 12

Do while xcount 0

'unspecified code if statement
textbox(xcount).value = something.

loop

Just curious. This would help me simplify the work greatly. Any
ideas?
Cheers,
dw


--
toocold
------------------------------------------------------------------------
toocold's Profile:

http://www.excelforum.com/member.php...o&userid=31608
View this thread: http://www.excelforum.com/showthread...hreadid=532998




toocold[_23_]

Textbox Problem
 

Thanks Bob, I will give that a shot.
Cheers,
dw


--
toocold
------------------------------------------------------------------------
toocold's Profile: http://www.excelforum.com/member.php...o&userid=31608
View this thread: http://www.excelforum.com/showthread...hreadid=532998



All times are GMT +1. The time now is 03:40 PM.

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