Tags: automatically, ctrl, date, enter, enters, excel, formula, generate, macro, microsoft, msdn, software, static, user

Enter Static Date with a formula or macro

On Microsoft » Microsoft Excel

4,677 words with 3 Comments; publish: Thu, 22 May 2008 18:51:00 GMT; (306156.25, « »)

Is it possible to enter a static date with out using ctrl + ;. I want to be

able to have the date automatically generate when the user enters data in a

field and not have the date change when the system date changes.

All Comments

Leave a comment...

  • 3 Comments
    • Jason, use something like Sheet1.Range("A1") = Date

      --

      Paul B

      Always backup your data before trying something new

      Please post any response to the newsgroups so others can benefit from it

      Feedback on answers is always appreciated!

      Using Excel 2002 & 2003

      "Jason Southco" <JasonSouthco.excel.todaysummary.com.discussions.microsoft.com> wrote in message

      news:E36E30C9-B38A-41AD-9D12-DC6B2D9730FF.excel.todaysummary.com.microsoft.com...

      > Is it possible to enter a static date with out using ctrl + ;. I want to

      > be

      > able to have the date automatically generate when the user enters data in

      > a

      > field and not have the date change when the system date changes.

      #1; Thu, 22 May 2008 18:52:00 GMT
    • I am kind of a novice... where do I put that? Within a macro?

      "Paul B" wrote:

      > Jason, use something like Sheet1.Range("A1") = Date

      > --

      > Paul B

      > Always backup your data before trying something new

      > Please post any response to the newsgroups so others can benefit from it

      > Feedback on answers is always appreciated!

      > Using Excel 2002 & 2003

      >

      > "Jason Southco" <JasonSouthco.excel.todaysummary.com.discussions.microsoft.com> wrote in message

      > news:E36E30C9-B38A-41AD-9D12-DC6B2D9730FF.excel.todaysummary.com.microsoft.com...

      > > Is it possible to enter a static date with out using ctrl + ;. I want to

      > > be

      > > able to have the date automatically generate when the user enters data in

      > > a

      > > field and not have the date change when the system date changes.

      >

      >

      #2; Thu, 22 May 2008 18:53:00 GMT
    • Jason,

      Yes that would be in a macro, it would put the date in sheet1 cell A1 when

      you run it,

      To put in this macro, from your workbook right-click the workbook's icon and

      pick View Code. This icon is to the left of the "File" menu this will open

      the VBA editor, in Project Explorer click on your workbook name, if you

      don't see it press CTRL + r to open the Project Explorer, then go to insert,

      module, and paste the code in the window that opens on the right hand side,

      press Alt and Q to close this window and go back to your workbook and press

      alt and F8, this will bring up a box to pick the Macro from, click on the

      Macro name to run it. If you are using excel 2000 or newer you may have to

      change the macro security settings to get the macro to run. To change the

      security settings go to tools, macro, security, security level and set it to

      medium

      Sub AddDate

      'Will put the date in sheet1 cell A1

      Sheet1.Range("A1") = Date

      End Sub

      if you are new to macros you may also what to have a look here on getting

      started with macros

      http://www.mvps.org/dmcritchie/excel/getstarted.htm

      If you want to put the date in a cell when you put data in another cell have

      a look here for ways to do it.

      http://www.mcgimpsey.com/excel/timestamp.html

      If you need more help post back with more details of what you want to do.

      --

      Paul B

      Always backup your data before trying something new

      Please post any response to the newsgroups so others can benefit from it

      Feedback on answers is always appreciated!

      Using Excel 2002 & 2003

      "Jason Southco" <JasonSouthco.excel.todaysummary.com.discussions.microsoft.com> wrote in message

      news:E031E4EF-1F2A-4646-A69F-CB5CDC863EF2.excel.todaysummary.com.microsoft.com...

      >I am kind of a novice... where do I put that? Within a macro?

      > "Paul B" wrote:

      >> Jason, use something like Sheet1.Range("A1") = Date

      >> --

      >> Paul B

      >> Always backup your data before trying something new

      >> Please post any response to the newsgroups so others can benefit from it

      >> Feedback on answers is always appreciated!

      >> Using Excel 2002 & 2003

      >>

      >> "Jason Southco" <JasonSouthco.excel.todaysummary.com.discussions.microsoft.com> wrote in message

      >> news:E36E30C9-B38A-41AD-9D12-DC6B2D9730FF.excel.todaysummary.com.microsoft.com...

      >> > Is it possible to enter a static date with out using ctrl + ;. I want

      >> > to

      >> > be

      >> > able to have the date automatically generate when the user enters data

      >> > in

      >> > a

      >> > field and not have the date change when the system date changes.

      >>

      #3; Thu, 22 May 2008 18:54:00 GMT