View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.newusers
Luke M Luke M is offline
external usenet poster
 
Posts: 2,722
Default Macro moving with daily date

'Assuming row corresponds to date:

Sub MyMacro()
Dim x As Integer

'Determine what day it is
x = Format(Date, "d")

Cells(x, "G").Formula = "=TODAY()"
Cells(x, "J").FormulaR1C1 = "=RC[-1]*7"
Cells(x, "K").FormulaR1C1 = "=R[7]C[-5]"
Cells(x, "K") = Cells(x, "K").Value
Range("E2:E9").ClearContents

End Sub
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"paintbrush" wrote:

Macro needs to move with date down a row each day including other cell
referances when I run the macro.
--
paintbrush
Here is day 3 macro below, or do I need to make 31
Macros?
Range("G3").Select
ActiveCell.FormulaR1C1 = "=TODAY()"
Range("J3").Select
ActiveCell.FormulaR1C1 = "=RC[-1]*7"
Range("K3").Select
ActiveCell.FormulaR1C1 = "=R[7]C[-5]"
Range("K3").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("E2:E9").Select
Selection.ClearContents