Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default ActiveX control dilemma

I have a "master" ActiveX Combobox on a sheet which I copy & paste anything
up to 30 times for each client. I would like to shift the focus from the
control after it has had a data change (say select the linked cell for that
control). The problem as I see it is that even though I can have a change
macro for the master it would need to be duplicated for each control and
that's not really feasible (using Chip Pearson's code to copy a macro into a
module).

Is there a more generic way that I can set it up to select the control's
linked cell (or any other cell) please?. Brett
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default ActiveX control dilemma

You can have a common routine for all the controls. You need to have a
minimum of 3 lines in each On change macro

Private Sub ListBox1_Click()
call CommonClick
end Sub

You may need to pass a parameter to the common routine depending on what you
are doings

Private Sub ListBox1_Click()
call CommonClick("listbox1")
end Sub

"Brett" wrote:

I have a "master" ActiveX Combobox on a sheet which I copy & paste anything
up to 30 times for each client. I would like to shift the focus from the
control after it has had a data change (say select the linked cell for that
control). The problem as I see it is that even though I can have a change
macro for the master it would need to be duplicated for each control and
that's not really feasible (using Chip Pearson's code to copy a macro into a
module).

Is there a more generic way that I can set it up to select the control's
linked cell (or any other cell) please?. Brett

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default ActiveX control dilemma

Hi Joel, actually each macro would only be that long
PS
Range select
ES
but the problem is creating that macro for each control anyway (there's 90
potential comboboxes, of which up to 30 can be used at any given time, so
they're created on demand).


"joel" wrote:

You can have a common routine for all the controls. You need to have a
minimum of 3 lines in each On change macro

Private Sub ListBox1_Click()
call CommonClick
end Sub

You may need to pass a parameter to the common routine depending on what you
are doings

Private Sub ListBox1_Click()
call CommonClick("listbox1")
end Sub

"Brett" wrote:

I have a "master" ActiveX Combobox on a sheet which I copy & paste anything
up to 30 times for each client. I would like to shift the focus from the
control after it has had a data change (say select the linked cell for that
control). The problem as I see it is that even though I can have a change
macro for the master it would need to be duplicated for each control and
that's not really feasible (using Chip Pearson's code to copy a macro into a
module).

Is there a more generic way that I can set it up to select the control's
linked cell (or any other cell) please?. Brett

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default ActiveX control dilemma

You are going to have to have the 30 or 90 mactos. When you create the
control on demand you have to give the control one of the 90 names of the
prediefined macrtos. You dont have to create the macro after the control
exists.

VBA will give the control a name which you can change after to create it on
demand to the control name match the name in the predefined macro.

"Brett" wrote:

Hi Joel, actually each macro would only be that long
PS
Range select
ES
but the problem is creating that macro for each control anyway (there's 90
potential comboboxes, of which up to 30 can be used at any given time, so
they're created on demand).


"joel" wrote:

You can have a common routine for all the controls. You need to have a
minimum of 3 lines in each On change macro

Private Sub ListBox1_Click()
call CommonClick
end Sub

You may need to pass a parameter to the common routine depending on what you
are doings

Private Sub ListBox1_Click()
call CommonClick("listbox1")
end Sub

"Brett" wrote:

I have a "master" ActiveX Combobox on a sheet which I copy & paste anything
up to 30 times for each client. I would like to shift the focus from the
control after it has had a data change (say select the linked cell for that
control). The problem as I see it is that even though I can have a change
macro for the master it would need to be duplicated for each control and
that's not really feasible (using Chip Pearson's code to copy a macro into a
module).

Is there a more generic way that I can set it up to select the control's
linked cell (or any other cell) please?. Brett

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default ActiveX control dilemma

Hi Joel - yes, I thought it may end up as that, but I was trying to avoid
carrying all those macros around in each book (one of them has 3 x 90
potentials!). Thanks, Brett

"joel" wrote:

You are going to have to have the 30 or 90 mactos. When you create the
control on demand you have to give the control one of the 90 names of the
prediefined macrtos. You dont have to create the macro after the control
exists.

VBA will give the control a name which you can change after to create it on
demand to the control name match the name in the predefined macro.

"Brett" wrote:

Hi Joel, actually each macro would only be that long
PS
Range select
ES
but the problem is creating that macro for each control anyway (there's 90
potential comboboxes, of which up to 30 can be used at any given time, so
they're created on demand).


"joel" wrote:

You can have a common routine for all the controls. You need to have a
minimum of 3 lines in each On change macro

Private Sub ListBox1_Click()
call CommonClick
end Sub

You may need to pass a parameter to the common routine depending on what you
are doings

Private Sub ListBox1_Click()
call CommonClick("listbox1")
end Sub

"Brett" wrote:

I have a "master" ActiveX Combobox on a sheet which I copy & paste anything
up to 30 times for each client. I would like to shift the focus from the
control after it has had a data change (say select the linked cell for that
control). The problem as I see it is that even though I can have a change
macro for the master it would need to be duplicated for each control and
that's not really feasible (using Chip Pearson's code to copy a macro into a
module).

Is there a more generic way that I can set it up to select the control's
linked cell (or any other cell) please?. Brett

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
2007 Form Control/ActiveX Control font difference Nikko963 Excel Discussion (Misc queries) 0 April 15th 09 04:21 PM
publish activeX combobox and other activeX control irene c Excel Programming 0 March 19th 07 07:19 AM
Help with using an activex control CrazyPhilll Excel Programming 7 April 24th 06 09:28 AM
How to control "Date Time Picker ActiveX Control" Jafery Excel Programming 1 July 21st 05 02:38 PM


All times are GMT +1. The time now is 12:01 PM.

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"