+ Reply to Thread
Results 1 to 6 of 6

Time and Date Macro

  1. #1
    Registered User
    Join Date
    10-28-2009
    Location
    United State
    MS-Off Ver
    Excel 2007
    Posts
    2

    Time and Date Macro

    Write a macro to put the current date and time in cell A1 on Sheet1. It should display the current date and time to the second. The time only has to change when you run the macro. Create a hotspot to run the macro.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Time and Date Macro

    Hello dlh116,

    Welcome to the Forum!

    What do you mean by a "hot spot"?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    10-28-2009
    Location
    United State
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Time and Date Macro

    I am not exactly sure. Those were the instruction I was given by my professor. I'm guessing it is supposed to be hot key.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Time and Date Macro

    This is a college question?

    I believe a "hotspot" is more often used on web pages.

    Is your professor teaching Excel?

    Here's an example - click timer to update, as it appears to be homework you cn figure out how it's done
    Attached Files Attached Files
    Last edited by royUK; 10-28-2009 at 03:51 PM.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Forum Contributor
    Join Date
    10-28-2009
    Location
    Portland, Maine
    MS-Off Ver
    Excel 2003
    Posts
    102

    Re: Time and Date Macro

    This would work for the macro. I assume he wants it assigned to a button (see attached worksheet).
    Please Login or Register  to view this content.
    Hope this works out...
    Later
    Attached Files Attached Files
    Last edited by royUK; 10-28-2009 at 04:20 PM. Reason: add code tags

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Time and Date Macro

    YUNESM

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

    You do not need to select cells in VBA. Your code adds the NOW formula to the cell, this will change whenever the sheet is updated
    Last edited by royUK; 10-28-2009 at 04:19 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1