Results 1 to 7 of 7

Copy & Paste Cell Values based on conditions to separate sheets from primary sheet

Threaded View

  1. #1
    Registered User
    Join Date
    12-01-2017
    Location
    New Jersey
    MS-Off Ver
    2016
    Posts
    63

    Copy & Paste Cell Values based on conditions to separate sheets from primary sheet

    Hello,
    I am stuck on finishing this code. The Input sheet is "Qlik_VT11 that has job numbers in column A. There are 4 output sheets defined below in the code with each having 2 conditions on the inout sheet that determine where the job number will get copied and pasted to. The primary sheet should loop until complete based on Column A. All output sheets will get pasted into Column A with each entry placed under the last. I started code from parts I found online and added the conditions into If & IfElse statements. I'm not sure I have the code correct for looping through the primary sheet and do not have code to place each entry in the output shttes into the next row down. Need some help

    Sub Shipments()
    
    Dim LR As Long, i As Long
        With Sheets("Qlik_VT11")
            LR = .Range("A" & Rows.Count).End(xlUp).Row
            
            'erow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
    
            For i = 1 To LR
                With .Range("A" & i)
                    If Cells(i, 3).Value = "NW" And Cells(i, 9).Value = "Performance Plastics" Then
    
                        Sheets("Qlik_VT11").Range("A1:A1").Copy Destination:=Sheets("Performance Plastics").Range("A2:A2")
                        
                    ElseIf Cells(i, 3).Value = "NW" And Cells(i, 9).Value = "Specialty Products" Then
    
                        Sheets("Qlik_VT11").Range("A1:A1").Copy Destination:=Sheets("Specialty Products").Range("A2:A2")
                        
                    ElseIf Cells(i, 3).Value = "NW" And Cells(i, 9).Value = "Material Sciences" Then
    
                        Sheets("Qlik_VT11").Range("A1:A1").Copy Destination:=Sheets("Material Sciences").Range("A2:A2")
                        
                    ElseIf Cells(i, 3).Value = "NW" And Cells(i, 9).Value = "Corteva & Performance Materials" Then
    
                        Sheets("Qlik_VT11").Range("A1:A1").Copy Destination:=Sheets("Corteva & Perf Materials").Range("A2:A2")
                        
                    End If
                End With
            Next i
        End With
    Last edited by spyac; 07-02-2018 at 10:14 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Copy Paste From Rawdata Sheets to Multiple Sheets Based on Sheet names
    By farrukh in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-16-2017, 11:01 PM
  2. [SOLVED] Copy Paste a Range of Values from a Different Sheet Based on Value Entered in Cell
    By hamidxa in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-13-2015, 04:53 PM
  3. Copy Values to separate sheet, locate value in list and paste 6 cells to the left
    By drknot in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-16-2014, 10:16 AM
  4. Need to select data based on conditions in a separate sheet then return the values
    By scottmcclean in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-14-2014, 03:39 PM
  5. [SOLVED] Macro to copy and paste based on criteria to 11 separate sheets
    By msmith7113 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-11-2013, 02:30 AM
  6. Copy and paste data to separate sheets based on mutiple criteria again
    By Ricker090 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-13-2011, 02:23 PM
  7. Copy and paste data to separate sheets based on mutiple criteria
    By Ricker090 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-21-2011, 03:48 PM

Tags for this Thread

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