+ Reply to Thread
Results 1 to 3 of 3

Cutting and pasting between worksheets based on a column

Hybrid View

  1. #1
    Registered User
    Join Date
    02-28-2013
    Location
    Harrogate, England
    MS-Off Ver
    Excel 2007
    Posts
    44

    Cutting and pasting between worksheets based on a column

    Hi,

    I am trying to filter a mass amount of exported data into separate excel worksheets to look at in more detail but wanted to split them depending on what is in one column.

    I have the following code atm, which I have been using on a different speadsheet but it just is not working within this one.

    Any help be appreciated, as I am still learning vba, I can't see the problems very easily.




    Private Sub Worksheet_Change(ByVal Target As Range)
    
    'Shift of Non Conformances
    
    
    Application.EnableEvents = False
    For Each cell In Target
        With cell
            Select Case cell.Column
                          
                Case 17     'column Q changed
    
                        'INC
                If LCase(.Value) = "Non Conformance" Then
                
                        .EntireRow.Copy Worksheets("INC").Cells(Rows.Count, 1).End(xlUp)(2, 1)
                        .EntireRow.Delete
                  
                        'OOS
                ElseIf .Value = "OOS" Then
                        .EntireRow.Copy Worksheets("OOS").Cells(Rows.Count, 1).End(xlUp)(2, 1)
                        .EntireRow.Delete
                        
                        
                  End If
                
                              
            End Select
        End With
    Next cell
    Application.EnableEvents = True
    
    End Sub

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Cutting and pasting between worksheets based on a column

    Maybe:

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("Q:Q")) Is Nothing Then
        Select Case Target.Value
            Case Is = "Non Conformance"
                Rows(Target.Row).Copy Worksheets("INC").Cells(Rows.Count, 1).End(xlUp)(2, 1)
                Rows(Target.Row).Delete
            Case Is = "OOS"
                Rows(Target.Row).Copy Worksheets("OOS").Cells(Rows.Count, 1).End(xlUp)(2, 1)
                Rows(Target.Row).Delete
        End Select
    End If
    End Sub

  3. #3
    Registered User
    Join Date
    02-28-2013
    Location
    Harrogate, England
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Cutting and pasting between worksheets based on a column

    Hi John,

    thanks, but this seems not to work either...but thanks for trying, any other suggestions or areas that would be the issue?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA for cutting and pasting a row based on one cell
    By JM88 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-13-2014, 11:38 PM
  2. VBA Cutting and Pasting from one worksheet to another based on value
    By aeewing in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-20-2013, 10:27 AM
  3. Cutting row and pasting into new sheet based on criteria
    By goose1000 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-18-2011, 11:54 PM
  4. cutting a row and pasting to a column
    By wolfdogg in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-23-2005, 05:05 PM
  5. [SOLVED] Help Please Cutting and pasting based on cell value
    By Mike in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-18-2005, 10:06 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