Results 1 to 2 of 2

every time a cell matches take the whole row and paste it in another worksheet

Threaded View

  1. #1
    Registered User
    Join Date
    01-31-2014
    Location
    East Coast, England
    MS-Off Ver
    Excel 2010
    Posts
    44

    every time a cell matches take the whole row and paste it in another worksheet

    Hi Folks,

    Spot the issue please

        
    
        Dim usLrow As Integer
        Dim z As Integer
        
            Sheets("Thuraya IP").Copy Before:=Sheets(1)
            Sheets("Thuraya IP (2)").Name = "Summary"
        
            usLrow = Sheets("Summary").Range("A" & Rows.Count).End(xlUp).Row: z = 1
        
                Worksheets("Summary").Range("A1:G" & usLrow).RemoveDuplicates Columns:=1, Header:= _
                    xlYes
            
            Range("D:G").Delete
            
            Cells(1, 4).Value = "Total Free Usage"
            Cells(1, 5).Value = "Total Usage"
            Cells(1, 6).Value = "Total Chargeable Usage"
            
        
        
    
        Dim o As Integer
        Dim c As Range
        Dim SIMno As Range
         
         For Each SIMno In Sheets("Summary").Range("A2:A" & usLrow)
                If SIMno >= 1 Then
                
                    ThisWorkbook.Worksheets.Add(After:=Sheets("Summary")).Name = SIMno
                
                       For Each c In Sheets("Thuraya IP").Range("A1:A" & Lrow)
                            If c.Value = SIMno Then
                              c.EntireRow.Cut Worksheets(SIMno).Range("A" & o)
                    o = o + 1
                End If
            
        Next c
        
                End If
        
        Next SIMno
    This is a section of my code I need it to check a range for a SIM number then match that SIM number as many times as it appears in a different worksheet then for each time it appears copy the whole row it appears on to the spread sheet with the corresponding SIM number. The RedText is where it fails. I know it would be helpful if I posted the file but I dont have time right now to strip the personal data so any help correcting my statement would be great.

    Thanks,

    Rich
    Last edited by Richard_Thornton; 07-09-2014 at 11:33 AM. Reason: Yellow text was clearly the wrong choice.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] If a cell in a diffeent tab matches then paste..
    By m_789 in forum Excel General
    Replies: 4
    Last Post: 05-01-2014, 10:23 AM
  2. Replies: 1
    Last Post: 04-04-2014, 06:03 AM
  3. Copy and paste row to worksheet that matches column name
    By Topper73 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-12-2013, 12:29 PM
  4. Macro to Copy & Paste when worksheet names matches
    By Arinp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-30-2012, 06:54 PM
  5. macro to compare time between two cells if time matches output in third cell
    By kshitij_dch in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-31-2012, 07:09 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