Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Call Event and Load Form based on Variable

Hi all,
I have some problem with dynamic things :
1) I need to call an event which the event name was saved in a
variable.
Eg :
Dim sEventName as String
sEventName = "Button1_Click"

Call sEventName

2) And how to load Form based on variable too?
Eg :
Dim sFormName as String
sFormName = "Form1"

Load sFormName

Hope someone can help me to solve the problems.

Thanks a lot!

Resant

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Call Event and Load Form based on Variable

use Application.run

Application.Run sEventName


http://support.microsoft.com/kb/157609/en-us
XL97: How to Display a UserForm Whose Name Is in a Variable

--
Regards,
Tom Ogilvy




"Resant" wrote in message
ups.com...
Hi all,
I have some problem with dynamic things :
1) I need to call an event which the event name was saved in a
variable.
Eg :
Dim sEventName as String
sEventName = "Button1_Click"

Call sEventName

2) And how to load Form based on variable too?
Eg :
Dim sFormName as String
sFormName = "Form1"

Load sFormName

Hope someone can help me to solve the problems.

Thanks a lot!

Resant



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Call Event and Load Form based on Variable

Wonderful!
You save my time...
Thanks a lot Tom

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Call Event and Load Form based on Variable

Tom,
More question....
Is there any coding that could tell what the last macro that have been
run from other Workbook?

Thanks,

Resant

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Call Event and Load Form based on Variable

Not Unless you have the macro write that information someplace where you can
access it; there is no built in support for it.

--
Regards,
Tom Ogilvy

"Resant" wrote:

Tom,
More question....
Is there any coding that could tell what the last macro that have been
run from other Workbook?

Thanks,

Resant


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
how to call the event of other worksheet chad Excel Worksheet Functions 1 May 30th 07 09:48 AM
How to call an event procedure Ben Excel Programming 2 December 6th 05 05:40 PM
user form-on open event? keydown event? FSt1[_3_] Excel Programming 2 August 5th 04 02:26 PM
how to call a macro from a worksheet event? lopsided[_3_] Excel Programming 5 December 16th 03 10:28 AM
call a sub with arguments from Worksheet_FollowHyperlink event Tom Ogilvy Excel Programming 5 August 28th 03 10:58 PM


All times are GMT +1. The time now is 07:45 AM.

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"