Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default accessing controls

hi all

i have a question about how controls are accessed (maybe that's not phrased
properly but i'll try and explain.)

i have a multipage with several pages - each page contains labels,
textboxes, and comboboxes.

when i do:

For i = 0 To MultiPage1.Pages.Count - 1
counter = 0
For Each o In MultiPage1.Pages(i).Controls
If TypeName(o) < "Label" Then
ActiveCell.Offset(0, counter).Value = o.Value
counter = counter + 1
End If
Next
ActiveCell.Offset(0,counter).Select
Next i

it will go through and put the value of each textbox/combobox in the
successive cell on the worksheet. however, the order at which it goes
through them is a bit baffling.

on page 1 (from top to bottom) the boxes are named:
textbox1, textbox2, textbox3....etc
and the tab order is set
textbox1, textbox2, textbox3.... etc

my question is why does it access in this order:
8,1,4,5,6,7,3,2

is there a way to change this order?

and secondly - at runtime (when debugging usint the immediate window)
is there a way to get the 'name' of the control being looked at?

ie if a breakpoint is set at
For i = 0 To MultiPage1.Pages.Count - 1
and i am stepping through, how can i see the 'name' (ie textbox1) of the
current control?

tia!

J

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default accessing controls

Is the order in which they were added?

--
HTH

Bob Phillips

"Gixxer_J_97" wrote in message
...
hi all

i have a question about how controls are accessed (maybe that's not

phrased
properly but i'll try and explain.)

i have a multipage with several pages - each page contains labels,
textboxes, and comboboxes.

when i do:

For i = 0 To MultiPage1.Pages.Count - 1
counter = 0
For Each o In MultiPage1.Pages(i).Controls
If TypeName(o) < "Label" Then
ActiveCell.Offset(0, counter).Value = o.Value
counter = counter + 1
End If
Next
ActiveCell.Offset(0,counter).Select
Next i

it will go through and put the value of each textbox/combobox in the
successive cell on the worksheet. however, the order at which it goes
through them is a bit baffling.

on page 1 (from top to bottom) the boxes are named:
textbox1, textbox2, textbox3....etc
and the tab order is set
textbox1, textbox2, textbox3.... etc

my question is why does it access in this order:
8,1,4,5,6,7,3,2

is there a way to change this order?

and secondly - at runtime (when debugging usint the immediate window)
is there a way to get the 'name' of the control being looked at?

ie if a breakpoint is set at
For i = 0 To MultiPage1.Pages.Count - 1
and i am stepping through, how can i see the 'name' (ie textbox1) of the
current control?

tia!

J



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default accessing controls

thats a good question - and it could very well be....
i'll move them around/rename them and see what happens.

thanks for the tip Bob

J


"Bob Phillips" wrote:

Is the order in which they were added?

--
HTH

Bob Phillips

"Gixxer_J_97" wrote in message
...
hi all

i have a question about how controls are accessed (maybe that's not

phrased
properly but i'll try and explain.)

i have a multipage with several pages - each page contains labels,
textboxes, and comboboxes.

when i do:

For i = 0 To MultiPage1.Pages.Count - 1
counter = 0
For Each o In MultiPage1.Pages(i).Controls
If TypeName(o) < "Label" Then
ActiveCell.Offset(0, counter).Value = o.Value
counter = counter + 1
End If
Next
ActiveCell.Offset(0,counter).Select
Next i

it will go through and put the value of each textbox/combobox in the
successive cell on the worksheet. however, the order at which it goes
through them is a bit baffling.

on page 1 (from top to bottom) the boxes are named:
textbox1, textbox2, textbox3....etc
and the tab order is set
textbox1, textbox2, textbox3.... etc

my question is why does it access in this order:
8,1,4,5,6,7,3,2

is there a way to change this order?

and secondly - at runtime (when debugging usint the immediate window)
is there a way to get the 'name' of the control being looked at?

ie if a breakpoint is set at
For i = 0 To MultiPage1.Pages.Count - 1
and i am stepping through, how can i see the 'name' (ie textbox1) of the
current control?

tia!

J




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default accessing controls

and yep = that seems to have done it

Thanks Bob!

J


"Gixxer_J_97" wrote:

thats a good question - and it could very well be....
i'll move them around/rename them and see what happens.

thanks for the tip Bob

J


"Bob Phillips" wrote:

Is the order in which they were added?

--
HTH

Bob Phillips

"Gixxer_J_97" wrote in message
...
hi all

i have a question about how controls are accessed (maybe that's not

phrased
properly but i'll try and explain.)

i have a multipage with several pages - each page contains labels,
textboxes, and comboboxes.

when i do:

For i = 0 To MultiPage1.Pages.Count - 1
counter = 0
For Each o In MultiPage1.Pages(i).Controls
If TypeName(o) < "Label" Then
ActiveCell.Offset(0, counter).Value = o.Value
counter = counter + 1
End If
Next
ActiveCell.Offset(0,counter).Select
Next i

it will go through and put the value of each textbox/combobox in the
successive cell on the worksheet. however, the order at which it goes
through them is a bit baffling.

on page 1 (from top to bottom) the boxes are named:
textbox1, textbox2, textbox3....etc
and the tab order is set
textbox1, textbox2, textbox3.... etc

my question is why does it access in this order:
8,1,4,5,6,7,3,2

is there a way to change this order?

and secondly - at runtime (when debugging usint the immediate window)
is there a way to get the 'name' of the control being looked at?

ie if a breakpoint is set at
For i = 0 To MultiPage1.Pages.Count - 1
and i am stepping through, how can i see the 'name' (ie textbox1) of the
current control?

tia!

J




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
Accessing the Solver Add-in in VBA BigHairyUglyGuy Excel Discussion (Misc queries) 1 April 8th 08 03:21 PM
ActiveX Controls vs Form Controls Alex Excel Discussion (Misc queries) 1 January 11th 06 08:46 AM
Event procedures for controls added with Controls.Add John Austin[_4_] Excel Programming 1 March 9th 05 03:31 PM
Accessing the values of form controls on worksheets in Excel 2000 robbinma Excel Programming 2 August 28th 03 08:35 AM
Accessing ActiveX Controls using VBA - can't use Control.Name to access. Rob Bovey Excel Programming 2 July 30th 03 09:11 AM


All times are GMT +1. The time now is 04:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"