+ Reply to Thread
Results 1 to 2 of 2

Thread: Current Time

  1. #1
    Registered User
    Join Date
    10-16-2011
    Location
    St. Pete Florida
    MS-Off Ver
    Excel 2007
    Posts
    4

    Current Time

    Hello all,
    I want the time (maybe time & date) to automatically fill in a cell when info is put into another cell. I have used an IF formula with NOW() but it changes whenever any cell is changed and I need it not to change after its inputted.
    Thanks

  2. #2
    Forum Guru Domski's Avatar
    Join Date
    12-14-2009
    MS-Off Ver
    What does it matter?
    Posts
    3,933

    Re: Current Time

    Hi,

    In it's most basic form this is how to achieve this using VBA:

    Private Sub Worksheet_Change(ByVal Target As Range)
    
        If Target.Address <> "$A$1" Then Exit Sub
        Target.Offset(0, 1) = Now
    
    End Sub

    Right click on the sheet tab, select View Code and paste the above onto the code page that appears.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

+ 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.2.0