LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default A Couple of Macro Questions

Paul

You need to enter in the spreadsheet something when the
macro has been run. This will have to be deleted in a
Before_Print or Before_Save macro.

Just change the ranges and sheet names to this.
Sub MyCopy()
Dim done, MyDate As Date
Worksheets(2).Select
MyDate = Range("A1")
done = Range("A2").Value
'Exit if it has been done
If Not IsEmpty(done) Then
Exit Sub
End If
If MyDate = #10/1/2003# And MyDate <= #12/31/2003#
Then
With Sheets("sheet1")
Range("g8:g44").Value = Range("A8:A44").Value
End With
End If
Range("A2").Value = "Y"
End Sub

sub Before_Print()
Range("A2").clearcontents
End Sub

Regards
Peter

-----Original Message-----
I would like a macro to automatically run if the date is
anywhere in a given 8 week period. For example, if the
date is greater then October 1, I would like the macro to
run and I only want it to run once.

The code I have put in place is:

If Date=October1 then
Sheets("FORECAST").Select
Range("AA8:AA44").Select
Selection.Copy
Range("Z8:Z44").Select
Selection.PasteSpecial Paste:=xlPasteValues,
Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A1:A3").Select
Application.CutCopyMode = False
Else End

Can someone review and let me know if this is right.

Also,
how do I only get it to run once?
.



 
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
couple of questions cjbarron5 Excel Discussion (Misc queries) 10 June 2nd 08 01:46 AM
A couple of questions [email protected] Excel Discussion (Misc queries) 3 November 22nd 06 03:39 AM
Couple of Questions Toysforfids Excel Discussion (Misc queries) 4 September 14th 06 05:20 AM
A couple of questions... littlegreenmen1 Excel Discussion (Misc queries) 0 June 10th 05 09:40 PM
Couple more questions... Poor microsoft user New Users to Excel 1 April 27th 05 03:20 PM


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