Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Setting attributes for controls

Just to add, for ActiveX boxes on a worksheet with name like textbox1 to
txtbox9

Dim obj as OleObject
Dim tbox as MSForms.TextBox
for each obj in Activesheet.OleObjects
if typeof obj.Object is MSForms.Textbox then
set tBox = obj.Object
idx = clng(right(tbox.name,1))
if idx = 5 and idx <=9 then
tbox.Value = ""
end if
End if
Next

On a userform

Dim tbox as MSForms.TextBox
dim ctrl as Control
for each ctrl in Userform1.Controls
if typeof ctrl is MSforms.TextBox then
set tbox = ctrl

End if
Next

or

for i = 5 to 9
Userform1.Controls("Textbox" & i).Value = ""
Next i



--
Regards,
Tom Ogilvy


Harald Staff wrote in message
...
Hi

There are checkboxes and checkboxes. The ones from the Forms toolbar are

part of its
Checkboxes collection, so you can address #5 as Checkboxes(5). The ActiveX

boxes from the
Controls toolbar are not, you have to deal with them one by one.

--
HTH. Best wishes Harald
Followup to newsgroup only please.

"Don Madsen" wrote in message
...
If a sheet has CheckBox1 .....CheckBox20 and you want to program to hide
certain ones based on some criteria. For example, making CheckBox5 to
CheckBox9 Visible.False?






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
Data value display attributes linked to table attributes MDT at Paragon Home Inspections, LLC Charts and Charting in Excel 0 November 15th 06 12:53 AM
ActiveX Controls vs Form Controls Alex Excel Discussion (Misc queries) 1 January 11th 06 08:46 AM
Setting character attributes in a text string Greg Neill Excel Worksheet Functions 1 June 15th 05 08:47 PM
Setting form controls focus and enter key John T Ingato Excel Programming 1 October 6th 03 05:13 PM
setting procedure attributes Chip Pearson Excel Programming 0 September 3rd 03 02:18 PM


All times are GMT +1. The time now is 11:37 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"