Excel help please

P

Paul Moles

Ensure security levels are no higher than medium so that
macro can run and thenuse this to insert new row and date.

Sub Auto_Open()
'
' Insert_Row_Date Macro
'

'
Range("A1").Select
Selection.EntireRow.Insert
ActiveCell.FormulaR1C1 = "=TODAY()"
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues,
Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False

End Sub


Use Conditional Formatting on Format menu to set two
conditions.
Cell Value is Greater than or equl to =$A$1+15
format as you like using format button along side for
Font, Border and Pattern,
Second condition Cell Value is less than or qual to
=$A$1+15 again format (but differently), press OK.
Use Format Painter to copy this conditional formatting as
far down column as you need.

Each time book is opened a new row is inserted at the top
with date in cell A1, Conditional format will provide
colour change once date plus today is more than 15.

HTH

Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top