Insert Static Date as part of Macro

  • Thread starter Ralph Bender, MBA
  • Start date
R

Ralph Bender, MBA

I've built a nice macro, but I want it to insert the date it is run in an
empty cell within the macro's range. When working within a spreadsheet, Ctrl
+; returns the system date, but I can't figure out how to put that command
into a macro.

The macro recorder editor shows that the system recognizes the entry as the
current date, not a function that returns the current date.

The now() or today() functions are both dynamic ... they change with the
system date. That's not acceptable in this situation. I need to seen when
the macro was run.

Thanks for any help,
Ralph
 
D

Dave Peterson

dim SomeCell as range
set somecell = worksheets("somesheet").range("a1")

somecell.value = date

or

with somecell
.numberformat = "mm/dd/yyyy"
.value = date
end with
 
Top