Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 160
Default ReturnBoolean???

Hi,


I have a UserForm with one of the TextBoxes having the 'Exit' event to it...

TextBox_01_Exit(ByVal Cancel As MSForms.ReturnBoolean)

This works fine - no problem here :-)

But, from another macro in the UserForm, I want to call this macro to
avoid double-coding, since the very same code should be run in the other
macro.

So, I try...

Call TextBox_01_Exit
Call TextBox_01_Exit(True)
Call TextBox_01_Exit(False)

....but none of these works?!?

How do I call the 'Exit' event from another macro???


Thanks in advance,

CE

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 538
Default ReturnBoolean???

Charlotte E. wrote:

I have a UserForm with one of the TextBoxes having the 'Exit' event to
it...

TextBox_01_Exit(ByVal Cancel As MSForms.ReturnBoolean)

This works fine - no problem here :-)

But, from another macro in the UserForm, I want to call this macro to
avoid double-coding, since the very same code should be run in the other
macro.

So, I try...

Call TextBox_01_Exit
Call TextBox_01_Exit(True)
Call TextBox_01_Exit(False)

...but none of these works?!?

How do I call the 'Exit' event from another macro???


Like this, in the calling function:
Dim x As MSForms.ReturnBoolean
TextBox_01_Exit x

If Cancel is set to True *in the Exit event*, then the control keeps the
focus.

--
It's sort of like a Gordian Knot,
although a Gordian Death Spiral might be more descriptive.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 160
Default ReturnBoolean???

Works perfectly :-)

Thanks :-)

CE


Den 08.04.2012 12:07, Auric__ skrev:
Dim x As MSForms.ReturnBoolean
TextBox_01_Exit x

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
"ByVal Cancel As MSForms.ReturnBoolean" rbyteme Excel Programming 3 October 12th 05 04:32 PM


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