Auto Fill Column with Date based on rows in other column

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a spreadsheet that has 5 columns in it. The report varies in length
every day. I want Column E to prefill with todays date as many rows as in
column A, the header for this column is "ConfDate". This code is not
working, any help you can give me is appreciated. Thanks

ActiveCell.FormulaR1C1 = "ConfDate"
Columns("E:E").Select
Range("E:E").Activate
Selection.Style = "=TODAY()"
 
with
range([e1],cells(intersect(activesheet.usedrange,[a:a]).rows.count,5))
value=date
numberformat="dd/mm/yyyy"
end with
[e1].value="ConfDate"


Col
 
Thanks so much, this worked great!! I altered it a bit just to do the same
thing in column 4 to prefill "Gesa cc" and I now get an error. the error says
"compile Error: Expected End with"

Here is what I did, can you see what is wrong? Thanks a bunch

'Enters todays date into rows equal to as many rows as column A

With Range([e1], Cells(Intersect(ActiveSheet.UsedRange,
[a:a]).Rows.Count, 5))
.Value = Date
.NumberFormat = "dd/mm/yyyy"

End With

With Range([d1], Cells(Intersect(ActiveSheet.UsedRange,
[a:a]).Rows.Count, 4))
.Value = "Gesa CC"

End With

End Sub
 

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

Back
Top