Naked Science Forum

Welcome, Guest. Please login or register.
Did you miss your activation email?
21/05/2013 18:21:09

Author Topic: How do I set Excel to change the date automatically?  (Read 9149 times)

ukmicky

  • Hero Member
  • *****
  • Posts: 3012
    • View Profile
    • http://www.space-talk.com/
  • on: 23/04/2008 00:25:29
Please please please I'm hooked on and trying to teach myself excel and need help doing something .

I can change the date automtically in excel by typing in =today() in cell B2

However i would be prefer to change the date in B2 by creating a text box/ button so it updates only when i click on the button.


Howwwwwwww



« Last Edit: 25/04/2008 21:50:08 by chris »

DoctorBeaver

  • Too Much Free Time Level Member
  • **********
  • Posts: 12659
  • A stitch in time would have confused Einstein.
    • View Profile
  • Reply #1 on: 23/04/2008 22:23:54
If I remember correctly, you can do it using events and form controls. I don't use Excel any more (OpenOffice rules!), but I'm sure that's how it's done. Check out macros, events, triggers and form controls in the help system.

MonikaS

  • Sr. Member
  • ****
  • Posts: 279
    • View Profile
  • Reply #2 on: 24/04/2008 12:27:35
You need to write a small macro:

Sub UpDateDate()
'
' UpDateDate
' made by MonikaS
'
      D = CDate(FormatDateTime(Now, vbShortDate))
      Range("B5").Value = D
End Sub


Attach this to a graphic on your spreedsheet and each time you click the graphic the date will change to the current date in cell B5.

HTH
Monika

ukmicky

  • Hero Member
  • *****
  • Posts: 3012
    • View Profile
    • http://www.space-talk.com/
  • Reply #3 on: 24/04/2008 21:27:00
You need to write a small macro:

Sub UpDateDate()
'
' UpDateDate
' made by MonikaS
'
      D = CDate(FormatDateTime(Now, vbShortDate))
      Range("B5").Value = D
End Sub





Attach this to a graphic on your spreedsheet and each time you click the graphic the date will change to the current date in cell B5.

HTH
Monika
Thankyou i will try it

DoctorBeaver

  • Too Much Free Time Level Member
  • **********
  • Posts: 12659
  • A stitch in time would have confused Einstein.
    • View Profile
  • Reply #4 on: 25/04/2008 07:24:21
You need to write a small macro:

Sub UpDateDate()
'
' UpDateDate
' made by MonikaS
'
      D = CDate(FormatDateTime(Now, vbShortDate))
      Range("B5").Value = D
End Sub


Attach this to a graphic on your spreedsheet and each time you click the graphic the date will change to the current date in cell B5.

HTH
Monika

Yeah, you can do it that way if you really must  :P

MonikaS

  • Sr. Member
  • ****
  • Posts: 279
    • View Profile
  • Reply #5 on: 25/04/2008 08:30:58
Well, he wanted a button to click on ;D
Without a button Crtl . (it's a dot) would insert the current date using the default datetime format.
Monika

DoctorBeaver

  • Too Much Free Time Level Member
  • **********
  • Posts: 12659
  • A stitch in time would have confused Einstein.
    • View Profile
  • Reply #6 on: 25/04/2008 21:42:32
Well, he wanted a button to click on ;D
Without a button Crtl . (it's a dot) would insert the current date using the default datetime format.
Monika

Button, Schmutton... oy vay!

ukmicky

  • Hero Member
  • *****
  • Posts: 3012
    • View Profile
    • http://www.space-talk.com/
  • Reply #7 on: 26/04/2008 02:05:23
Thankyou MonikaS

It works brilliantly ,now i can click on a transparent box and it changes the date underneath  8D

Dont worry doc i know you would have figured it out for me sooner or later ::)


DoctorBeaver

  • Too Much Free Time Level Member
  • **********
  • Posts: 12659
  • A stitch in time would have confused Einstein.
    • View Profile
  • Reply #8 on: 26/04/2008 15:52:11

Dont worry doc i know you would have figured it out for me sooner or later ::)


I doubt it as I don't use Excel. I switched to OpenOffice a couple of years ago. I don't even have Excel on my PCs anymore.

I was sent an Excel spreadsheet a few days ago - 42k in size. I loaded it into OpenCalc and saved it in .ods format - 17k. That's 1 of the reasons I don't use Excel.
« Last Edit: 26/04/2008 15:54:54 by DoctorBeaver »

 

Naked Scientists Science Radio Show Home Who are The Naked Scientists Information about Naked Scientists
Naked Scientists Podcast Ask the Naked Scientists Podcast Question of the Week Podcast
Naked Science Articles Experiments to do at Home Science Discussion Forum
Science News Stories Answers to Science Questions Interviews with Famous Scientists

Information presented on this website is the opinion of the individual contributors and does not reflect the general views of the administrators, editors, moderators, sponsors, Cambridge University or the public at large.

Click here for the Naked Scientists PODCAST

The contents of this site are © The Naked Scientists® 2000-2013. The Naked Scientists® and Naked Science™ are registered trademarks.


Powered by MySQL Powered by PHP SMF 2.0 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!