+ Reply to Thread
Results 1 to 6 of 6

Macro that changes a cell when another one has a date populated in it.

  1. #1
    Registered User
    Join Date
    02-13-2013
    Location
    Grand Rapids, Michigan, USA
    MS-Off Ver
    Excel 2007
    Posts
    15

    Macro that changes a cell when another one has a date populated in it.

    Hello,

    I have an excel that has a date column and a days out column. What I am looking for is when the date column has the date inserted in it, the macro changes the 'days out cell next to it, to the word done.

    I have this working except for a small portion. The macro doesn't recognize the date format.

    I have a time stamp that people will use that uses the formula =NOW() and has the format mm/dd/yy, hh:mm:ss. This formula doesn't see that???

    I am now very confused!

    Here is the macro so far:
    Private Sub Workbook_Open()
    Dim LastRow As Long
    Dim i As Long
    LastRow = Range("J" & Rows.Count).End(xlUp).Row
    For i = 4 To LastRow
    If Range("J" & i).Value = "TEST" Then
    Range("K" & i).Value = "DONE"
    End If
    Next i
    End Sub

  2. #2
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Macro that changes a cell when another one has a date populated in it.

    You code is looking for the word "Test" in column J, not a date value.
    Gary's Student

  3. #3
    Registered User
    Join Date
    02-13-2013
    Location
    Grand Rapids, Michigan, USA
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Macro that changes a cell when another one has a date populated in it.

    Oh! I forgot that part, I was using the word TEST to make sure that the macro would work. But now I need it to see the date like written above. Sorry!

  4. #4
    Registered User
    Join Date
    02-13-2013
    Location
    Grand Rapids, Michigan, USA
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Macro that changes a cell when another one has a date populated in it.

    I am still looking for an answer on this, my boss would really like this to be done tomorrow! Thank you all so much!

  5. #5
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Macro that changes a cell when another one has a date populated in it.

    Try this:

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    02-13-2013
    Location
    Grand Rapids, Michigan, USA
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Macro that changes a cell when another one has a date populated in it.

    Thank you so much! I am learning this new stuff little bits at a time!

+ 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