Hi,
I'm having problems writing some basic code as a newbie:
<CODE>
Sub DateFormulas()
<CODE></CODE>
<CODE>'Firstly, enter in A1 the most recent work day</CODE>
<CODE></CODE>
<CODE>Application.Goto Reference:="R2C1"
ActiveCell.FormulaR1C1 = _
"=IF(WEEKDAY(TODAY(),2)=6,TODAY()-1,IF(WEEKDAY(TODAY(),2 =7,TODAY()-2,TODAY()))"
<CODE>
</CODE>
<CODE></CODE>
<CODE>'Secondly in A2 enter the previous working day date</CODE>
<CODE></CODE>
<CODE>Range("A3").Select
ActiveCell.FormulaR1C1 = _
"=IF(WEEKDAY(R[-3]C[-3],2)=1,R[-3]C[-3]-3,R[-3]C[-3]-1)"
<CODE>
</CODE><CODE><CODE></CODE>
<CODE></CODE>
<CODE>Could you please help by advising on my next lines of code which copies the formula down but only until the cell where the formula result = 02/03/2009?</CODE>
<CODE></CODE>
<CODE>Thanks so much for your help</CODE>
<CODE></CODE>
<CODE>Steve
</CODE></CODE>
</CODE></CODE>
</CODE>
I'm having problems writing some basic code as a newbie:
<CODE>
Sub DateFormulas()
<CODE></CODE>
<CODE>'Firstly, enter in A1 the most recent work day</CODE>
<CODE></CODE>
<CODE>Application.Goto Reference:="R2C1"
ActiveCell.FormulaR1C1 = _
"=IF(WEEKDAY(TODAY(),2)=6,TODAY()-1,IF(WEEKDAY(TODAY(),2 =7,TODAY()-2,TODAY()))"
<CODE>
</CODE>
<CODE></CODE>
<CODE>'Secondly in A2 enter the previous working day date</CODE>
<CODE></CODE>
<CODE>Range("A3").Select
ActiveCell.FormulaR1C1 = _
"=IF(WEEKDAY(R[-3]C[-3],2)=1,R[-3]C[-3]-3,R[-3]C[-3]-1)"
<CODE>
</CODE><CODE><CODE></CODE>
<CODE></CODE>
<CODE>Could you please help by advising on my next lines of code which copies the formula down but only until the cell where the formula result = 02/03/2009?</CODE>
<CODE></CODE>
<CODE>Thanks so much for your help</CODE>
<CODE></CODE>
<CODE>Steve
</CODE></CODE>
</CODE></CODE>
</CODE>