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

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
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,213,556
Messages
6,114,284
Members
448,562
Latest member
Flashbond

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