#1
|
|||
|
|||
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, |
#2
|
|||
|
|||
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 |
Tags |
copy/paste rows |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
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 |