Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 454
Default Call Macro If x 2 Q

Need a small bit of help, in calling a Macro (A below) if cell AE60,
if it is or isn't I still want to to test and run (B) below, do I have
the syntax of my End If's correct?

...........
(A) If Sheets("Sheet1").Range("AE6").Value 0 Then

Mail_New_Version 'run this sub macro

Call UncheckBoxes
Call DelAllCheckBoxes


(B) If Weekday(Sheets("Input").Range("BF1")) = vbMonday _
And Sheets("E-Mail").Range("AE6").Value = 0 Then
MailToBobWeekly '<------ run this sub macro


Call UncheckBoxes
Call DelAllCheckBoxes

End If
End if
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Call Macro If x 2 Q

try this
If Sheets("Sheet1").Range("AE6").Value 0 Then
Mail_New_Version 'run this sub macro
Call UncheckBoxes
Call DelAllCheckBoxes
End If
If Weekday(Sheets("Input").Range("BF1")) = vbMonday _
And Sheets("E-Mail").Range("AE6").Value = 0 Then
MailToBobWeekly '<------ run this sub macro
Call UncheckBoxes
Call DelAllCheckBoxes
End if


"Sean" wrote:

Need a small bit of help, in calling a Macro (A below) if cell AE60,
if it is or isn't I still want to to test and run (B) below, do I have
the syntax of my End If's correct?

...........
(A) If Sheets("Sheet1").Range("AE6").Value 0 Then

Mail_New_Version 'run this sub macro

Call UncheckBoxes
Call DelAllCheckBoxes


(B) If Weekday(Sheets("Input").Range("BF1")) = vbMonday _
And Sheets("E-Mail").Range("AE6").Value = 0 Then
MailToBobWeekly '<------ run this sub macro


Call UncheckBoxes
Call DelAllCheckBoxes

End If
End if
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 454
Default Call Macro If x 2 Q

Thanks Mike, I was unsure of where to place both End If's

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 454
Default Call Macro If x 2 Q

I can't get the following extract of code to work, it doesn't execute
as I expect

My cells values a-
AE6 = 0
BF1 = 18/02/08 i.e. Monday

Thus I expect Mail_New_Version to be 'skipped' and MailToBobWeekly to
execute. What am I doing incorrectly?

If Sheets("Input").Range("AE6").Value 0 Then
Mail_New_Version '<-----run this sub macro
End If
If Weekday(Sheets("Input").Range("BF1")) = vbMonday _
And Sheets("Input").Range("AE6").Value = 0 Then
Call MailToBobWeekly '<---------run this sub macro
End If

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 367
Default Call Macro If x 2 Q

On Feb 18, 5:07*pm, Sean wrote:
I can't get the following extract of code to work, it doesn't execute
as I expect

My cells values a-
AE6 = 0
BF1 = 18/02/08 i.e. Monday

Thus I expect Mail_New_Version to be 'skipped' and MailToBobWeekly to
execute. What am I doing incorrectly?

* * If Sheets("Input").Range("AE6").Value 0 Then
* * Mail_New_Version * * *'<-----run this sub macro
* * End If
* * If Weekday(Sheets("Input").Range("BF1")) = vbMonday _
* * * * * * *And Sheets("Input").Range("AE6").Value = 0 Then
* * * * Call MailToBobWeekly * * * '<---------run this sub macro
* * End If


Hey Sean

Try to debug, if
debug.print Weekday(Sheets("Input").Range("BF1"))
gives you the correct output or not.

The code looks fine for me.

hth
Carlo


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 454
Default Call Macro If x 2 Q

Thanks Carlo, Weekday = 2, which is what I expect

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 can run a macro ( call a macro) on selection of any filtercriteria? [email protected] Excel Worksheet Functions 7 February 20th 09 12:34 AM
Call an Access macro from an Excel macro Jason W Excel Discussion (Misc queries) 1 May 1st 08 08:33 PM
Excel Macro call Word Macro with Parameters Bill Sturdevant[_2_] Excel Programming 9 May 24th 07 12:21 AM
Call macro stored in Excel workbook from Outlook's macro Gvaram Excel Programming 0 October 4th 06 05:47 PM
Call Macro in Add-in Andibevan[_2_] Excel Programming 3 May 10th 05 06:18 PM


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