Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Tab Order Automation??


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Tab Order Automation??

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Tab Order Automation??

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Tab Order Automation??


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
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
How to change series plotting order without changing legend order? PatrickM Charts and Charting in Excel 6 December 2nd 09 07:43 PM
For chart syles, why doesn't color order match series order? AMiller Charts and Charting in Excel 1 October 29th 09 12:02 AM
How stop Excel file UK date order changing to US order in m.merge Roger Aldridge Excel Discussion (Misc queries) 1 October 9th 07 11:52 PM
Daily Macro to Download Data, Order and paste in order Iarla Excel Worksheet Functions 1 November 17th 04 01:59 PM
Daily Macro to Download Data, Order and paste in order Iarla Excel Programming 1 November 17th 04 11:55 AM


All times are GMT +1. The time now is 05:38 AM.

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"