Copy row and insert n times
Solved/Closed
Related:
- Yy macro ps5
- Copy each row x times excel - Best answers
- Excel duplicate rows n times - Best answers
- Saints row 2 cheats - Guide
- You have guessed too many times ✓ - WhatsApp Forum
- Times attack - Download - Children
- Insert check mark in word - Guide
- How to insert photo in word for resume - Guide
22 responses
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Aug 5, 2010 at 11:20 PM
Aug 5, 2010 at 11:20 PM
BRI this is reply to BRI
you should have opened a new thread.
I have multiple worksheets within the workbook that I would like to link to the "CURRENT" worksheet
This is not clear. I am rephrasing sit. See whether I reflect your ideas.
There are many sheet let us gallaher1, gallaher 2 etc with yes or no in column D of each of these sheets. There is also another unique sheet called "current". You have filter out the rows containing "no" in column D of gallaher sheets and copy it to the now empty sheet current.
I have configured a sample workbook which you can download from the following web page.
https://authentification.site/files/23681915/Bri.xls
The sheet current is after running the macro "test"
For rechecking you can again run the macro "test". It clears the entries in "current" and again fills its up with filtered data.
When writing the criteria in the macro the spelling and the case should be correct.
The macro is
you should have opened a new thread.
I have multiple worksheets within the workbook that I would like to link to the "CURRENT" worksheet
This is not clear. I am rephrasing sit. See whether I reflect your ideas.
There are many sheet let us gallaher1, gallaher 2 etc with yes or no in column D of each of these sheets. There is also another unique sheet called "current". You have filter out the rows containing "no" in column D of gallaher sheets and copy it to the now empty sheet current.
I have configured a sample workbook which you can download from the following web page.
https://authentification.site/files/23681915/Bri.xls
The sheet current is after running the macro "test"
For rechecking you can again run the macro "test". It clears the entries in "current" and again fills its up with filtered data.
When writing the criteria in the macro the spelling and the case should be correct.
The macro is
Sub test() Dim r As Range, dest As Range, j As Integer, k As Integer Dim r1 As Range j = Worksheets.Count Worksheets("current").Cells.Clear For k = 1 To j If Worksheets(k).Name = "Current" Then GoTo nextk With Worksheets(k) Set r = .UsedRange r.AutoFilter field:=4, Criteria1:="No" Set r1 = r.Offset(1, 0) MsgBox r.Address r1.Cells.SpecialCells(xlCellTypeVisible).Copy With Worksheets("current") Set dest = .Cells(Rows.Count, "A").End(xlUp).Offset(1, 0) dest.PasteSpecial End With r.AutoFilter End With nextk: Next k Worksheets("Gallaher1").Range("A1").EntireRow.Copy Worksheets("current").Range("A1").PasteSpecial End Sub