Proper way to fire events

G

Guest

Guest
Hi,
I have a ListBox1 that responds to a click event by running function ListBox1_Click().

I have a CommandButton1 that responds to a click event by running function CommandButton1_Click()

I want, by clicking CommandButton1, a Click event for ListBox1 to be fired. Did this..

Sub CommandButton1_Click()
ListBox1_Click
End Sub

kinda works.. but Excel's displaying the sheets all wrong now.. ie its not cleared
Tried RaiseEvent, but that does not work

Question: How do I correctly fire an event?
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
I have no real idea of what your problems are as you haven't really told us, other than "Excel's displaying the sheets all wrong "

Try setting the TakeFocusOnClick property for the CommandButton to False.



_________________
Kind Regards
Dave Hawley
OzGrid Business Applications
Microsoft Excel/VBA Training
OzGrid.BusApp.170x45.gif

This message was edited by Dave Hawley on 2002-03-12 19:56
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,588
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top