Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have many userforms with several textboxes which require the same 'ta order' settings. Is there a way to automate this process for all of the commo userforms? Or can the tab order be copied from one form to another? Cheers Peter (new to VBA -- peter.thompso ----------------------------------------------------------------------- peter.thompson's Profile: http://www.excelforum.com/member.php...fo&userid=2968 View this thread: http://www.excelforum.com/showthread.php?threadid=49727 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Assuming that the textboxes all have the same name in each form,
use code like the following: Dim Ctrl As MSForms.Control Dim VBComp As VBIDE.VBComponent For Each VBComp In ThisWorkbook.VBProject.VBComponents If VBComp.Type = vbext_ct_MSForm Then For Each Ctrl In ThisWorkbook.VBProject. _ VBComponents("Userform1").Designer.Controls If TypeOf Ctrl Is MSForms.TextBox Then VBComp.Designer.Controls(Ctrl.Name).TabIndex = Ctrl.TabIndex End If Next Ctrl End If Next VBComp You'll need to set a reference to the Extensibility library. In VBA, go to the Tools menu, choose References, and scroll down to and check "Microsoft Visual Basic For Applications Extensibilitity Library". -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "peter.thompson" <peter.thompson.20zeoa_1136162101.0856@excelforu m-nospam.com wrote in message news:peter.thompson.20zeoa_1136162101.0856@excelfo rum-nospam.com... I have many userforms with several textboxes which require the same 'tab order' settings. Is there a way to automate this process for all of the common userforms? Or can the tab order be copied from one form to another? Cheers Peter (new to VBA) -- peter.thompson ------------------------------------------------------------------------ peter.thompson's Profile: http://www.excelforum.com/member.php...o&userid=29686 View this thread: http://www.excelforum.com/showthread...hreadid=497279 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I should have added that the tab order will be set in all forms
to match the tab order of UserForm1. Change "UserForm1" to the form whose tab order you want to copy. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Chip Pearson" wrote in message ... Assuming that the textboxes all have the same name in each form, use code like the following: Dim Ctrl As MSForms.Control Dim VBComp As VBIDE.VBComponent For Each VBComp In ThisWorkbook.VBProject.VBComponents If VBComp.Type = vbext_ct_MSForm Then For Each Ctrl In ThisWorkbook.VBProject. _ VBComponents("Userform1").Designer.Controls If TypeOf Ctrl Is MSForms.TextBox Then VBComp.Designer.Controls(Ctrl.Name).TabIndex = Ctrl.TabIndex End If Next Ctrl End If Next VBComp You'll need to set a reference to the Extensibility library. In VBA, go to the Tools menu, choose References, and scroll down to and check "Microsoft Visual Basic For Applications Extensibilitity Library". -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "peter.thompson" <peter.thompson.20zeoa_1136162101.0856@excelforu m-nospam.com wrote in message news:peter.thompson.20zeoa_1136162101.0856@excelfo rum-nospam.com... I have many userforms with several textboxes which require the same 'tab order' settings. Is there a way to automate this process for all of the common userforms? Or can the tab order be copied from one form to another? Cheers Peter (new to VBA) -- peter.thompson ------------------------------------------------------------------------ peter.thompson's Profile: http://www.excelforum.com/member.php...o&userid=29686 View this thread: http://www.excelforum.com/showthread...hreadid=497279 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks Chip, saved me hours! Cheers Peter -- peter.thompson ------------------------------------------------------------------------ peter.thompson's Profile: http://www.excelforum.com/member.php...o&userid=29686 View this thread: http://www.excelforum.com/showthread...hreadid=497279 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to change series plotting order without changing legend order? | Charts and Charting in Excel | |||
For chart syles, why doesn't color order match series order? | Charts and Charting in Excel | |||
How stop Excel file UK date order changing to US order in m.merge | Excel Discussion (Misc queries) | |||
Daily Macro to Download Data, Order and paste in order | Excel Worksheet Functions | |||
Daily Macro to Download Data, Order and paste in order | Excel Programming |