Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Calling Macro when using Select Case


Hi

In the code below i am tring to call another macro (ShowTotal) which i
located in the same WB and the other macro (SendD) is located in
different WB...

but no response........i mean the macros that tring to call them do no
response
and the rest of the Test macro works fine

Any idea why cannot call macro from this macro in particular...
might be select case procedure hinder calling macros...or somethin
ealse......???


PHP code
-------------------
Sub test()
Dim R As String
R = Sheet2.Range("C77")

Select Case R
Case "Ali"
Call ShowTotal
MsgBox "OK"

Case "Sami"
Call SendD
MsgBox "OK"
End Select
End Su
-------------------


Thank

--
helmekk

-----------------------------------------------------------------------
helmekki's Profile: http://www.excelforum.com/member.php...nfo&userid=693
View this thread: http://www.excelforum.com/showthread.php?threadid=27375

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default Calling Macro when using Select Case

The call to the macro in the same workbook should be OK, as long as the
called macro is in a standard module (not a class module or a module behind
a worksheet or userform).

If it does not execute, you might be failing the test, which is case
sensitive. That is, "ali" in your worksheet will not match "Ali" in your
Case statement.

To call a macro in another workbook, you must create a reference to the
other workbook in the VB Editor using Tools|References - or you can use a
construction like the following:

Application.Run "Book2.xls!SendD"

--
John Green
Sydney
Australia


"helmekki" wrote in message
...

Hi

In the code below i am tring to call another macro (ShowTotal) which is
located in the same WB and the other macro (SendD) is located in a
different WB...

but no response........i mean the macros that tring to call them do not
response
and the rest of the Test macro works fine

Any idea why cannot call macro from this macro in particular...
might be select case procedure hinder calling macros...or something
ealse......???


Formula:
--------------------
Sub test()
Dim R As String
R = Sheet2.Range("C77")

Select Case R
Case "Ali"
Call ShowTotal
MsgBox "OK"

Case "Sami"
Call SendD
MsgBox "OK"
End Select
End Sub
--------------------


Thank u


--
helmekki


------------------------------------------------------------------------
helmekki's Profile:

http://www.excelforum.com/member.php...fo&userid=6939
View this thread: http://www.excelforum.com/showthread...hreadid=273752



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
select case in vba Hein Excel Discussion (Misc queries) 5 November 25th 09 07:28 AM
Select Case ignored Preschool Mike Excel Worksheet Functions 4 September 9th 09 08:12 PM
Select Case jlclyde Excel Discussion (Misc queries) 5 January 6th 09 09:05 PM
Case Select NoodNutt Excel Worksheet Functions 7 September 21st 08 02:10 AM
Case without Select Case error problem Ayo Excel Discussion (Misc queries) 2 May 16th 08 03:48 PM


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