Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default list box dialogue msgbox

I have a list box, and when a different option is chosen from the list, I
need to either

a) create a macro that pops up a dialogue box to remind the user to press
some buttons to update the data,

or

b) create a macro that just goes ahead and updates the data.

I've already written the macros to update the data, I just can't figure out
how to join it up with the action of choosing a different option from the
list box. Any ideas?

Thanks in advance for your help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 638
Default list box dialogue msgbox

Can you not just use the Change event of the listbox?

Private Sub ListBox1_Change()
'your update code here
End Sub

Eileen wrote:
I have a list box, and when a different option is chosen from the list, I
need to either

a) create a macro that pops up a dialogue box to remind the user to press
some buttons to update the data,

or

b) create a macro that just goes ahead and updates the data.

I've already written the macros to update the data, I just can't figure out
how to join it up with the action of choosing a different option from the
list box. Any ideas?

Thanks in advance for your help.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default list box dialogue msgbox

On May 6, 8:10 am, Eileen wrote:
I have a list box, and when a different option is chosen from the list, I
need to either

a) create a macro that pops up a dialogue box to remind the user to press
some buttons to update the data,

or

b) create a macro that just goes ahead and updates the data.

I've already written the macros to update the data, I just can't figure out
how to join it up with the action of choosing a different option from the
list box. Any ideas?

Thanks in advance for your help.


You need to create a Change handler routine in the UserForm (or
worksheet) code module, something like this ...

Private Sub ListBox1_Change()
'Your handler code goes here (or invoke its subroutine)
msgbox "Press the buttons"
End Sub

The name of the Sub needs to match your control's name.

See the Excel help for the Events associated with the control for more
information and examples.

Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default list box dialogue msgbox

You could put an algorithm in the listbox click event like:

If listbox1.Selected(0) Then
Macro1
ElseIf listbox1.Selected(1) Then
Macro2
ElseIf listbox1.Selected(2) Then
Macro3
End if

Of course, if the list box has a large number of items in it, this might not
be practical.

"Eileen" wrote:

I have a list box, and when a different option is chosen from the list, I
need to either

a) create a macro that pops up a dialogue box to remind the user to press
some buttons to update the data,

or

b) create a macro that just goes ahead and updates the data.

I've already written the macros to update the data, I just can't figure out
how to join it up with the action of choosing a different option from the
list box. Any ideas?

Thanks in advance for your help.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default list box dialogue msgbox

That worked brilliantly, thanks!

"JW" wrote:

Can you not just use the Change event of the listbox?

Private Sub ListBox1_Change()
'your update code here
End Sub

Eileen wrote:
I have a list box, and when a different option is chosen from the list, I
need to either

a) create a macro that pops up a dialogue box to remind the user to press
some buttons to update the data,

or

b) create a macro that just goes ahead and updates the data.

I've already written the macros to update the data, I just can't figure out
how to join it up with the action of choosing a different option from the
list box. Any ideas?

Thanks in advance for your help.


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
Show Data validation List options in a msgbox jlclyde Excel Discussion (Misc queries) 1 October 28th 09 07:26 PM
Dialogue Box Flat disgusted Excel Discussion (Misc queries) 2 May 20th 08 06:46 PM
adding combo/list box to msgbox/inputbox thread Excel Programming 1 December 13th 07 01:14 AM
dialogue pop up Micayla Bergen Excel Discussion (Misc queries) 5 June 23rd 06 10:45 PM
MsgBox to list users in shared workbook systemx[_6_] Excel Programming 1 March 9th 06 03:05 PM


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