hi, I have a better way If you have a series of controls that you would like to format the same way...suggest you name the textbox "txtbxname_1" ("_1") becomes our unique identifyer)
for each..... if right(object.name,4) = "_1" then next next On Sun, Apr 5, 2009 at 8:46 PM, Ashish Jain <26may.1...@gmail.com> wrote: > > Hi Vincent > > It seems more like sharing information - and we dnt find any other way > to do this at runtime. If you've plz share with us. > > Regards > Ashish Jain > > On Apr 2, 6:09 pm, Yu <vincent2...@gmail.com> wrote: > > Hi Dear all, > > > > I have this puzzle for a long time. I often program UserForm and > > always format controls like this : > > > > .TextBox1.Height = 18 > > .TextBox1.Width = 100 > > .TextBox2.Height = 18 > > .TextBox2.Width = 100 > > .TextBox3.Height = 18 > > .TextBox3.Width = 100 > > .TextBox4.Height = 18 > > .TextBox4.Width = 100 > > .TextBox5.Height = 18 > > .TextBox5.Width = 100 > > > > I am thinking is there a collection like TextBoxes ,then you can > > refer to each textbox as TextBox(i) then just do > > loop like this: > > > > For Each tb in TextBoxes > > tb.height=18 > > tb.width=100 > > next tb > > > > Any ideas or any other way around that? > > > > Vincent > > > --~--~---------~--~----~------------~-------~--~----~ ------------------------------------------------------------------------------------- Some important links for excel users: 1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at http://www.excelitems.com 2. Excel tutorials at http://www.excel-macros.blogspot.com 3. Learn VBA Macros at http://www.vbamacros.blogspot.com 4. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com If you find any spam message in the group, please send an email to: Ayush Jain @ jainayus...@gmail.com or Ashish Jain @ 26may.1...@gmail.com ------------------------------------------------------------------------------------- -~----------~----~----~----~------~----~------~--~---