Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Call

Hi There,

Macro should recornize my "TargettedActiveSheet" as the active sheet openned
in Excel. The active sheet's name should be returned & set as
"TargettedActiveSheet" so that my macro call use this returned name to call
the correct procedure that is intended to work on the active sheet.

So, if the active sheet name is Sheet1, then "TargettedActiveSheet" should
return Sheet1 as the reference for macro. If Sheet99 is the active sheet,
then "TargettedActiveSheet" should return Sheet99 so that Macro can recognize
the right name in order to invoke CALL the the sub procedure named "Sheet99"
so as to execute code & work out the macro I intended for Sheet99 or Sheet1
or any other active sheet.

How can I use make Macro do this? I tried the below but to no avail.

Sub Identify_And_Optimize_Target_File()
Dim TargettedActiveSheet As String
TargettedActiveSheet = ActiveWorkbook.ActiveSheet.Name
Call TargettedActiveSheet
End Sub


Private Sub Sheet1()
'Do as I intend for sheet1
End Sub


Private Sub Sheet99()
'Do as I intend for sheet99
End Sub

Thanks a lot

--
Edmund
(Using Excel XP)
 
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
Call Center Management: How to calculate 'cost per call' Denniso6 Excel Discussion (Misc queries) 2 June 25th 06 05:01 PM
Don't know what to call what I need? chanwando Excel Worksheet Functions 5 September 9th 05 10:01 PM
Run or Call MBlake[_2_] Excel Programming 7 August 27th 05 09:29 PM
call sub mike allen[_2_] Excel Programming 3 October 15th 04 04:54 PM
How do you call one Sub from another Sub ? lothario[_30_] Excel Programming 2 October 17th 03 01:47 PM


All times are GMT +1. The time now is 03:19 PM.

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"