Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 96
Default Running code on workdays

What do I need to do to get this to execute only on workdays?

Sheets("Cus Futures").Select
Range(" H9:I50").Copy Range("D9:E50")
Range("F9:I50").ClearContents
'
Sheets("House Futures").Select
Range(" H9:I50").Copy Range("D9:E50")
Range("F9:I50").ClearContents

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,420
Default Running code on workdays

If Weekday(Date, vbMonday) < 6 Then

With Worksheets("Cus Futures")

.Range(" H9:I50").Copy .Range("D9:E50")
.Range("F9:I50").ClearContents
End With

With Worksheets("House Futures")

.Range(" H9:I50").Copy .Range("D9:E50")
.Range("F9:I50").ClearContents
End With
End If


--
__________________________________
HTH

Bob

"chrisnsmith" wrote in message
...
What do I need to do to get this to execute only on workdays?

Sheets("Cus Futures").Select
Range(" H9:I50").Copy Range("D9:E50")
Range("F9:I50").ClearContents
'
Sheets("House Futures").Select
Range(" H9:I50").Copy Range("D9:E50")
Range("F9:I50").ClearContents



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7,247
Default Running code on workdays

If Weekday(Now, vbSaturday) = 3 Then
' your code here
End If

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Wed, 4 Feb 2009 09:53:01 -0800, chrisnsmith
wrote:

What do I need to do to get this to execute only on workdays?

Sheets("Cus Futures").Select
Range(" H9:I50").Copy Range("D9:E50")
Range("F9:I50").ClearContents
'
Sheets("House Futures").Select
Range(" H9:I50").Copy Range("D9:E50")
Range("F9:I50").ClearContents

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
Instead of debugging, code just stops running [email protected] Excel Discussion (Misc queries) 1 August 13th 08 07:26 PM
VB code for running a macro rcc Excel Discussion (Misc queries) 3 January 23rd 08 02:53 AM
Please Help Error 400 when running tested code Ditto Excel Discussion (Misc queries) 5 October 15th 07 01:24 PM
Automatically running code Richard Excel Worksheet Functions 1 February 7th 06 09:35 PM
running code mark New Users to Excel 3 March 14th 05 09:14 AM


All times are GMT +1. The time now is 12:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"