LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
HJ HJ is offline
external usenet poster
 
Posts: 28
Default Macro Revision needed

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
draw revision cloud sarvesh Excel Discussion (Misc queries) 1 December 13th 09 12:52 PM
Revision kbkst via OfficeKB.com Excel Discussion (Misc queries) 4 February 17th 06 07:12 PM
Revision Number John Excel Worksheet Functions 2 December 14th 04 05:29 PM
Macro Formula revision? Mark Excel Worksheet Functions 1 November 28th 04 01:43 AM
Notation on Revision of Projects Tim Childs Excel Programming 2 January 20th 04 10:27 PM


All times are GMT +1. The time now is 01:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"