VBA date to line code

Frank Freese
Frank Freese used Ask the Experts™
on
Folks,
I would like to add the date to a range:
Sub Copy_Paste()
Dim Tdate As Date

Worksheets("Forecast").Range("A4:E7").Copy Worksheets("Historical").Range("A2:E5")
Worksheets("Historical").Range("B2:E5").Interior.Color = vbBlue
Worksheets("Historical").Range("B2:E5").Font.Color = vbRed
Worksheets("Historical").Range("F2:F5").Now

Open in new window


I need to correct my code in the last line. How will that look?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Martin Liss"Life would be infinitely happier if we could only be born at the age of eighty and gradually approach eighteen." - Mark Twain
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
Worksheets("Historical").Range("F2:F5") = Now
Hardware Tester and Debugger
Commented:
Hi there! :)

If you need to only show and contain the date, change the last line to something like this.

Worksheets("Historical").Range("F2:F5") = Format(Now(), "dd-mmm-yyyy")

Open in new window

Author

Commented:
Thanks folks. Noah's solution met my objective.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial