+ Reply to Thread
Results 1 to 3 of 3

insert auto date when paste value in cell

Hybrid View

  1. #1
    Registered User
    Join Date
    03-07-2008
    Posts
    8

    insert auto date when paste value in cell

    hi

    i want insert date automatically in column "C" when copy paste something in column "B"
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    04-16-2009
    Location
    Dorset, UK
    MS-Off Ver
    Office 2003, Office 2007
    Posts
    131

    Re: insert auto date when paste value in cell

    You can do this with a macro. The following code should be placed in the module for the worksheet:

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Column = 2 Then Cells(Target.Row, 3) = Date
    End Sub

    This code checks every time any cell on the sheet is changed (the only event that's suitable) to see if the changed cell (Target) is in column B. If it is, it changes the cell in the same row but in column C to the current date.

  3. #3
    Valued Forum Contributor
    Join Date
    05-14-2009
    Location
    gold coast
    MS-Off Ver
    Excel 2007
    Posts
    843

    Re: insert auto date when paste value in cell

    Going off the sample workbook
    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Column = 3 Then
        Target.Offset(, 2) = Int(Now)
    End If
    End Sub
    though if you want to use columns B & C
    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Column = 2 Then
        Target.Offset(, 1) = Int(Now)
    End If
    End Sub
    Hope this helpos

+ 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