Link to home
Start Free TrialLog in
Avatar of Euro5
Euro5Flag for United States of America

asked on

VBA copy down today's date

Using this VBA code, I want to add today's date to column U along with the fill in columns V & W.
Can anyone help? Thank you! :)

Sub CopyFormulaDownfar()
Dim LastPopulatedRow As Long

Worksheets("FAR All").Activate
'Find last populated row
LastPopulatedRow = Range("A" & Rows.Count).End(xlUp).Row

'Select the rows where formula is to be populated

Range("V2: " & "V" & LastPopulatedRow).FillDown
Range("W2: " & "W" & LastPopulatedRow).FillDown

Open in new window

Avatar of Andrew Porter
Andrew Porter
Flag of United States of America image

I believe =Today() in the cell will get this done for you.
ASKER CERTIFIED SOLUTION
Avatar of Bembi
Bembi
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Euro5

ASKER

Bembi & Andrew -
Now()
Today()
Date

All show time - can I just get the short date? 5/17/2021
Range("...").value = Format$(now(), "DD-MM-YYYY") or similar.
There are also built in variables to use the computer format, I guess "short date"

The other option is just to format the cell...
Range("...").NumberFormat = "DD-MM-YYYY"

The first option writes only the date into the cell, but no time.
The second option would format the ceell to show the date, even the cell contains also the time.