+ Reply to Thread
Results 1 to 3 of 3

Auto move row to another tab

  1. #1
    Registered User
    Join Date
    04-20-2005
    Posts
    2

    Auto move row to another tab

    I want to move a row to a different tab automatically when a cell has a date in it.

    Example:
    Three columns: Task, Date Due, Date Completed

    When someone enters any date into the "Date Completed" column, the whole row moves to a tab named "Completed"

    Any ideas?

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Rascal


    You will need to paste this code into the worksheet module for the sheet that you are entering the completed date in

    I have assumed that column C is the date completion column


    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim Ws As Worksheet
    Dim NextRow As Long

    If Target.Column = 3 Then
    Application.EnableEvents = False
    If IsDate(Target.Value) Then

    Set Ws = Sheets("completed")
    NextRow = Ws.Cells(Rows.Count, "c").End(xlUp).Row + 1
    Stop
    Rows(Target.Row).Copy Destination:=Ws.Rows(NextRow)
    Rows(Target.Row).ClearContents
    End If
    Application.EnableEvents = True
    End If
    End Sub

  3. #3
    Registered User
    Join Date
    04-20-2005
    Posts
    2
    Perfect. Thanks a lot. I had to remove the "Stop".

+ 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