Insert Static Date as part of Macro

  • Thread starter Thread starter Ralph Bender, MBA
  • Start date 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
 
dim SomeCell as range
set somecell = worksheets("somesheet").range("a1")

somecell.value = date

or

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

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