Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA problem - prevent event to occur when certain button is clicked

Hi,
I have a VBA problem I just can't figure out.
I have a userform with, among others, a listbox, hidden label,
hidden image and a cancel button.
Now, what I already have is: when exiting the listbox (e.g. by going t
another control on the form) the hidden label and hidden image becom
visible and another listbox receives the focus.

Private Sub lbxArticles_Exit(ByVal Cancel As MSForms.ReturnBoolean)
lbxLotNumbers.SetFocus
imgArrow.Visible = True
lblWarning.Visible = True
End Sub

But when clicking the Cancel button the Exit event also occurs. So
always have to click the Cancel button twice to close the form.

Is there a way the let the Exit event occur except when the Cance
button is clicked ?

Thanks in advance,

Davi

--
Message posted from http://www.ExcelForum.com

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
let a sub recognise the name of the button that has been clicked. Brotherwarren Excel Discussion (Misc queries) 2 March 18th 06 10:56 AM
Problem occur in sum function while deleting the rows Ellis Yu Excel Worksheet Functions 0 October 26th 05 02:50 AM
Identifying Button Clicked Tom Ogilvy Excel Programming 0 July 23rd 04 06:38 PM
Pause macro, add form button to sheet, continue macro when button clicked! Flystar[_15_] Excel Programming 1 May 26th 04 09:45 AM
Button event clicked problem Marek Cvrk Excel Programming 2 October 14th 03 05:47 PM


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