+ Reply to Thread
Results 1 to 3 of 3

dates

Hybrid View

  1. #1
    Registered User
    Join Date
    11-15-2006
    Posts
    16

    dates

    is there a way to have the current date auto fill to a cell if enter a value on the same row..? instead of having to type in the date then the product or value?

  2. #2
    Forum Contributor
    Join Date
    03-14-2006
    Location
    Pakistan
    Posts
    1,791

    Lightbulb

    Quote Originally Posted by Radonsheep
    is there a way to have the current date auto fill to a cell if enter a value on the same row..? instead of having to type in the date then the product or value?
    if you enter value in cell A1 and want to show date in B1
    put in B1
    =IF(A1<>"",TODAY(),"")

    Regards.

  3. #3
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by Radonsheep
    is there a way to have the current date auto fill to a cell if enter a value on the same row..? instead of having to type in the date then the product or value?
    Hi,

    If you use a formula that tests the A column and inserts a date in the B column, then that date will update with each passing day.

    If you want to detect and retain the date on which an entry was made in the A column, then, on the worksheet tab, rightmouse and 'View Code' and copy the following code into there.
    Private Sub Worksheet_Change(ByVal Target As Range)
    Const WS_Range As String = "A1:A65536" ' <<< set your range
    Application.EnableEvents = False
    Application.ScreenUpdating = False
    On Error Resume Next
        If Not Intersect(Target, Me.Range(WS_Range)) Is Nothing Then
            iRow = Target.Row
            If Range("A" & iRow).Value <> "" And Range("B" & iRow).Value = "" Then Range("B" & iRow).Value = Date
        End If
    Application.EnableEvents = True
    Application.ScreenUpdating = True
    On Error GoTo 0
    End Sub
    hth
    ---
    Si fractum non sit, noli id reficere.

+ 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