Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
select case in vba | Excel Discussion (Misc queries) | |||
Select Case ignored | Excel Worksheet Functions | |||
Select Case | Excel Discussion (Misc queries) | |||
Case Select | Excel Worksheet Functions | |||
Case without Select Case error problem | Excel Discussion (Misc queries) |