Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Finding, copying and pasting

I want to get some code that will do a few functions for me. I have a
worksheet with 1000's of entries and I want to find and use only about
15 of them. I can find them by their name which is displayed in column
A, I then want to select the whole row and add it to a new worksheet.
I want to repeat this for the other 14 entries and add them to the
same new worksheet.

Any helpful thoughts?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Finding, copying and pasting

Put the 15 entries from column A in a new worksheet. then write a macro tha
wil only move these rows. I didn't test the code below but will do the job
after it is debugged. It may even work first time. I wrote a lot of code
just like this in the past.

Sub move_data()

Workbooks.Add
Set newbk = ActiveWorkbook
NewbkRowcount = 1

With ThisWorkbook.Sheets("sheet2")
Sh2Rowcount = 1
Do While .Range("A" & Sh2Rowcount) < ""
SearchName = .Range("A" & Sh2Rowcount)
With ThisWorkbook.Sheets("sheet1")
Sh1RowCount = 1
Do While .Range("A" & Sh1RowCount) < ""
If SearchName = .Range("A" & Sh1RowCount) Then
.Rows(Sh1RowCount).Copy _
Destination:=newbk.Sheets("sheet1").Rows(NewbkRowc ount)
NewbkRowcount = NewbkRowcount + 1
End If
Sh1RowCount = Sh1RowCount + 1
Loop
End With
Sh2Rowcount = Sh2Rowcount + 1
Loop
End With

End Sub






" wrote:

I want to get some code that will do a few functions for me. I have a
worksheet with 1000's of entries and I want to find and use only about
15 of them. I can find them by their name which is displayed in column
A, I then want to select the whole row and add it to a new worksheet.
I want to repeat this for the other 14 entries and add them to the
same new worksheet.

Any helpful thoughts?

Reply
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
Finding a match and pasting next to it Donna S Excel Discussion (Misc queries) 2 November 16th 06 07:34 PM
Help! finding data and pasting it to another sheet! MDC[_4_] Excel Programming 3 May 19th 06 12:19 AM
Finding and pasting over a row Big Chris[_35_] Excel Programming 1 July 27th 04 01:43 PM
Copying & Pasting Michael[_10_] Excel Programming 1 August 28th 03 11:00 AM
Finding a range for Copying & Pasting John R[_3_] Excel Programming 1 August 19th 03 03:54 PM


All times are GMT +1. The time now is 09:56 PM.

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

About Us

"It's about Microsoft Excel"