Calling Macro when using Select Case

H

helmekki

Hi :confused: :confused: :confused:

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
 
J

John Green

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"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top