Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following macro which copies certain rows from a large spreadsheet
to a separate worksheet. This macro currently copies rows 19, 20 and 21. I would like to add on to this macro to also copy rows 25, 26, 30, 32, 33, and 34 to that same worksheet. Can someone help with the code to add this data? I would like to have all the copied data on one tab (Data Master-Likely) and I'm not sure how to write the code to look for the first empty row on the newly created master tab (Data Master-Likely)and then loop through the process again. I hope that makes sense. Sub CopyLikelyDataData() Dim i As Long, rng As Range, sh As Worksheet Dim rng1 As Range Worksheets.Add(After:=Worksheets( _ Worksheets.Count)).Name = "Data Master-Likely" Set sh = Worksheets("Data Entry-Likely to Acquire") i = 19 Do While Not IsEmpty(sh.Cells(i, 1)) Set rng = Union(sh.Cells(i, 1), _ sh.Cells(i + 1, 1).Resize(2, 1)) rng.EntireRow.Copy Set rng1 = Worksheets("Data Master-Likely") _ .Cells(Rows.Count, 1).End(xlUp)(2) rng1.PasteSpecial xlValues rng1.PasteSpecial xlFormats i = i + 52 Loop End Sub Thanks in advance for your help. HJ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
draw revision cloud | Excel Discussion (Misc queries) | |||
Revision | Excel Discussion (Misc queries) | |||
Revision Number | Excel Worksheet Functions | |||
Macro Formula revision? | Excel Worksheet Functions | |||
Notation on Revision of Projects | Excel Programming |