View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
somethinglikeant somethinglikeant is offline
external usenet poster
 
Posts: 94
Default find and paste Blocks

Assuming you are running down column A. Change start cell if any
different.

Sub IDCopy()
[A1].Select
Do Until ActiveCell.Value = "GO"
ActiveCell.Offset(1, 0).Select
Loop
startrow = ActiveCell.Row
Do Until ActiveCell.Value = "TC"
ActiveCell.Offset(1, 0).Select
Loop
endrow = ActiveCell.Row - 1
Rows(startrow & ":" & endrow).Select

Selection.Copy
Workbooks.Add
ActiveSheet.Paste: Application.CutCopyMode = False
[A1].Select
End Sub

somethinglikeant


Taru wrote:
I need to find a specific ID in a database, then paste all of the stuff
below it into a new document. Now all of the Stuff that I want to copy
starts with GO: and I want it to copy every row below the ID, until it
runs into TC. TC is the beginning of the next ID.

How do I go about making something start copying right below something
it finds for an unkown number or rows, and then stop when it sees a
specific word?


--
Taru
------------------------------------------------------------------------
Taru's Profile: http://www.excelforum.com/member.php...o&userid=35494
View this thread: http://www.excelforum.com/showthread...hreadid=553372