Closed Thread
Results 1 to 13 of 13

anyway to make auto fill time value static?

  1. #1
    Registered User
    Join Date
    01-24-2009
    Location
    west coast,canada
    MS-Off Ver
    Excel 2003
    Posts
    6

    anyway to make auto fill time value static?

    I have 2 cell, A1 and B1. When any data is entered into A1, B1 will display the time corresponding to when the data was entered.

    I was thinking about function for B1 would be "=IF(A1="","",now()) ". It worked such that it will display the time, however the value in B1 will automatically update itself if I were to randomly input any data in any other cell too.

    For example, I input "testing" in A1. B1 display "11:20PM". Ten minutes later, I input "hello" in A2. B1 now display "11:30PM".

    Anyone know a way to stop B1 from updating? or only update when new data is entered into A1 only? Thanks.
    Last edited by Tezzz; 02-01-2009 at 05:18 PM.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe a event macro.

    Right click sheet tab > select view code > paste in the below

    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    01-24-2009
    Location
    west coast,canada
    MS-Off Ver
    Excel 2003
    Posts
    6
    It didn't seem to work.
    But thank tho.

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Should work unless it's a formula in A1

    See example

    VBA Noob
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-24-2009
    Location
    west coast,canada
    MS-Off Ver
    Excel 2003
    Posts
    6
    Ah it did work. Thank a lot VBA!

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  7. #7
    Registered User
    Join Date
    01-24-2009
    Location
    west coast,canada
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: anyway to make auto fill time value static?

    VBA, I need help figuring out how to set this up for a range. Such as I name A1:A5 = "Time" and with the respective formula in each cell, how would i make each cell auto fill time static? The macro worked for 1 cell, but anyway to make it for a range? Thank.

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: anyway to make auto fill time value static?

    another one is a udf

    Please Login or Register  to view this content.
    use as any function e.g.
    =IF(OR((A1)=" ",A1=0),"",puttime())

    this will hold the time unless a1 is cleared
    Last edited by martindwilson; 02-01-2009 at 08:31 AM.

  9. #9
    Registered User
    Join Date
    01-24-2009
    Location
    west coast,canada
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: anyway to make auto fill time value static?

    martindwilson, not sure if that worked. I have attached a simple example. Can you fill in the formula and code so i can see how you do it? Thanks.

    Basically, when any number is entered into "Cost" , its respective "time" will be displayed.
    Attached Files Attached Files

  10. #10
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: anyway to make auto fill time value static?

    there you go formula allows for someone just clearing cell with space
    i'd lock the cells with the formulas in though
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    01-24-2009
    Location
    west coast,canada
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: anyway to make auto fill time value static?

    Thank martindwilson.

  12. #12
    Registered User
    Join Date
    11-27-2010
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: anyway to make auto fill time value static?

    Quote Originally Posted by Tezzz View Post
    VBA, I need help figuring out how to set this up for a range. Such as I name A1:A5 = "Time" and with the respective formula in each cell, how would i make each cell auto fill time static? The macro worked for 1 cell, but anyway to make it for a range? Thank.
    I am in need of this same information. I tried martindwilson's code, but could not get it to work. Any more help for another newby. Thanks

  13. #13
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: anyway to make auto fill time value static?

    @dwogn, welcome to the board however please note:

    Your post does not comply with Rule 2 of our Forum RULES.
    Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread.

Closed 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