Results 1 to 2 of 2

Need help removing

Threaded View

jhumeniuk Need help removing 08-22-2014, 02:58 PM
Speshul Re: Need help removing 08-22-2014, 02:59 PM
  1. #1
    Registered User
    Join Date
    08-22-2014
    Location
    Maine
    MS-Off Ver
    2013
    Posts
    1

    Need help removing

    So I have a worksheet with a macro set to copy data from one sheet to other sheets depending on the value of column D. It is as follows:

    [ CODE]
    Sub test()
    Dim LR As Long, i As Long
    LR = Range("A" & Rows.Count).End(xlUp).Row
    For i = 2 To LR
    If Range("D" & i).Value = "Approved" Then Rows(i).Copy Destination:=Sheets("Approved").Range("A" & Rows.Count).End(xlUp).Offset(1)
    Next i

    LR = Range("A" & Rows.Count).End(xlUp).Row
    For i = 2 To LR
    If Range("D" & i).Value = "Rejected" Then Rows(i).Copy Destination:=Sheets("Rejected").Range("A" & Rows.Count).End(xlUp).Offset(1)
    Next i

    LR = Range("A" & Rows.Count).End(xlUp).Row
    For i = 2 To LR
    If Range("D" & i).Value = "Pending" Then Rows(i).Copy Destination:=Sheets("Pending").Range("A" & Rows.Count).End(xlUp).Offset(1)
    Next i

    End Sub
    [ /CODE]

    I also have it set up to trigger the move when the value is entered using the following:

    [ CODE]
    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Column = 4 And Target.Value = "Approved" Then Target.EntireRow.Copy Destination:=Sheets("Approved").Range("A" & Rows.Count).End(xlUp).Offset(1)
    If Target.Column = 4 And Target.Value = "Rejected" Then Target.EntireRow.Copy Destination:=Sheets("Rejected").Range("A" & Rows.Count).End(xlUp).Offset(1)
    If Target.Column = 4 And Target.Value = "Pending" Then Target.EntireRow.Copy Destination:=Sheets("Pending").Range("A" & Rows.Count).End(xlUp).Offset(1)

    End Sub
    [ /CODE]

    Where I am now stuck is trying to figure out how to remove the data from the sheet it was delivered to if the value of column D is changed. For example When the word "Pending" is entered into column D it copies the line over to a sheet titled "Pending". If I change that value in that cell to "Rejected" it copies the line over to the sheet titled "Rejected" but I need to have it also remove it from the sheet titled "Pending"

    Is this possible? Thank you!
    Last edited by jhumeniuk; 08-22-2014 at 03:02 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Removing #DIV/0!
    By andyperiam in forum Excel General
    Replies: 3
    Last Post: 12-07-2009, 02:48 AM
  2. removing #DIV/0!
    By akhlaq768 in forum Excel General
    Replies: 3
    Last Post: 10-09-2008, 05:58 AM
  3. Removing #DIV/0!
    By yorkshirekid in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-18-2008, 12:53 PM
  4. Removing #VALUE!
    By Tim in forum Excel General
    Replies: 1
    Last Post: 06-05-2006, 12:25 PM
  5. [SOLVED] Removing Chr(10)
    By Daniel Bonallack in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-21-2006, 07:40 AM

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