Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / January 2007

Tip: Looking for answers? Try searching our database.

Insert Static Date as part of Macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ralph Bender, MBA - 06 Jan 2007 00:09 GMT
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
Dave Peterson - 06 Jan 2007 00:13 GMT
dim SomeCell as range
set somecell = worksheets("somesheet").range("a1")

somecell.value = date

or

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

> 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
[quoted text clipped - 10 lines]
> Thanks for any help,
> Ralph

Signature

Dave Peterson


Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.