Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Reference combo box in after update sub.

I'm trying to call a function in the after update sub, and pass it the
name of the combobox, which has been updated. I'm just not sure how to
access this. Can anyone help?

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Reference combo box in after update sub.

ActiveControl.Name??

Hth,
Merjet


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Reference combo box in after update sub.

Each afterupdate event only refers to one combobox, so

Private Sub ComboBox1_AfterUpdate()
MyMacro ComboBox1
End Sub

Sub MyMacro(CBox As MSForms.ComboBox)
MsgBox CBox.Name & " " & CBox.Value
End Sub


--
Regards,
Tom Ogilvy


" wrote:

I'm trying to call a function in the after update sub, and pass it the
name of the combobox, which has been updated. I'm just not sure how to
access this. Can anyone help?

Thanks


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Reference combo box in after update sub.

On 28 Feb, 15:45, "merjet" wrote:
ActiveControl.Name??

Hth,
Merjet


Hi Merjet,

Thanks for the quick reply.
I've just tried that, but the combo box is on a multipage form, so
ActiveControl.Name just returns "multipage1".

Is there a way round this?

Laura

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Reference combo box in after update sub.

Ok, between the two replies, I now have what I need.

Many thanks!

Laura




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Reference combo box in after update sub.

for the edification of anyone reading this thread with a similar problem, my
original answer provided a complete solution and works fine whether with a
multipage or not and required no further modification.

Each afterupdate event only refers to one combobox, so

Private Sub ComboBox1_AfterUpdate()
MyMacro ComboBox1
End Sub

Sub MyMacro(CBox As MSForms.ComboBox)
MsgBox CBox.Name & " " & CBox.Value
End Sub

This discounts any special needs the OP may have had that were not stated in
the original question or follow on posts.

--
Regards,
Tom Ogilvy


" wrote:

Ok, between the two replies, I now have what I need.

Many thanks!

Laura



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
Input box to update combo box HFB Excel Programming 5 March 3rd 10 08:36 PM
Combo box update to field Esrei Excel Discussion (Misc queries) 1 June 26th 07 03:01 PM
combo reference on another combo box for picking address etc. kbjin Excel Worksheet Functions 1 December 8th 06 03:29 PM
Combo update filtering Profairy[_2_] Excel Programming 4 June 7th 04 08:14 PM
Combo Box Before Update Darb Excel Programming 1 May 11th 04 04:14 PM


All times are GMT +1. The time now is 02:33 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"