Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-26-2017, 03:59 PM
waqar1239 waqar1239 is offline copy a row and paste the row into another sheet more then one time:macro Windows 7 32bit copy a row and paste the row into another sheet more then one time:macro Office 2010 32bit
Novice
copy a row and paste the row into another sheet more then one time:macro
 
Join Date: Mar 2017
Posts: 1
waqar1239 is on a distinguished road
Default copy a row and paste the row into another sheet more then one time:macro

Hi Team,



I would like to copy a row when column "C" have some specific value and paste the whole row into another sheet three time. Every times when I paste the rows it should paste at the end of the last row and update the total last rows as well. And when column "C" does not match with the value then paste the row onto another sheet just one time.

Please advice,
Regards,
Reply With Quote
  #2  
Old 04-07-2017, 09:57 AM
dangelor dangelor is offline copy a row and paste the row into another sheet more then one time:macro Windows 7 64bit copy a row and paste the row into another sheet more then one time:macro Office 2016
Novice
 
Join Date: Apr 2017
Posts: 1
dangelor is on a distinguished road
Default

Possibly...
Code:
Sub Not_Tested()
    Dim rg               As Range
    Dim rC               As Range
    Dim a                As Integer
    
    'Change the names of the worksheets to match
    'Change "Some Specific Value" to ???

    With Worksheets(1)
        Set rC = Intersect(.Columns("C"), .UsedRange)
    End With
    For Each rg In rC
        If rg.Value = "Some Specific Value" Then
            For a = 1 To 3
                rg.EntireRow.Copy Worksheets(2).Cells(1048576, 1).End(xlUp).Offset(1)
            Next a
        Else
            rg.EntireRow.Copy Worksheets(3).Cells(1048576, 1).End(xlUp).Offset(1)
        End If
    Next rg
End Sub
Reply With Quote
Reply

Tags
copy/paste rows



Similar Threads
Thread Thread Starter Forum Replies Last Post
copy a row and paste the row into another sheet more then one time:macro How to copy excel sheet withe HEADER and Paste into new sheet? cloudforgiven Excel Programming 6 01-05-2017 07:30 PM
Trying to find a macro that will copy a cell and paste that value to a specific sheet bryans88 Excel Programming 1 12-23-2015 01:40 PM
copy checkbox string and paste it in excel sheet MOHAMMEDSALMAN Excel Programming 7 10-29-2015 03:50 AM
Want to change Macro to copy and paste data to new sheet Vortex69 Excel Programming 0 12-23-2014 09:53 PM
copy cell from sheet 2 to sheet 3 macro slipperyjim Excel Programming 1 02-18-2010 01:31 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:38 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft