Search : in
By :

Find and paste data into seperate sheet

Last answer on Nov 4, 2009 2:14:26 am GMT Jim Jones, on Nov 2, 2009 1:56:02 pm GMT 
 Report this message to moderators

Hello,

I need a macro that will search a specific range on one excell sheet--say G7:G56 and J7:J56 for a specific name--if it finds the name i want to copy and paste that into another excell worksheet--then look for another name and another pasting them in the order it finds them. Any help would be greatly appreciated.

Thanks

Configuration: Windows XP Internet Explorer 6.0

Best answers for « Find and paste data into seperate sheet » in :
How to split data into multiple worksheets? Show How to split data into multiple worksheets? Issue Solution Note Issue I hope someone can help! I have a .csv file open with excel that contains a large amount of data that has been merged together so that each data set follows each...
How to compare 2 excel sheet and combine uniq data? ShowHow to compare 2 excel sheet and combine uniq data? Issue Solution Note Issue I have 2 excel sheets , A and B. There are redundant data in both sheets as well as uniq. All i want is to combine both with no redundant records. (A+B...
[Ingres] Importing/ Exporting data Show[Ingres] Importing/ Exporting data Making use of these commands copydb unloaddb Notes Ingres allows you to export data from an Ingres installation to another (it is a platform independent procedure). unloaddb copydb The main...
Excel – Macro for copy & paste selected range ShowExcel – Macro for copy & paste selected range Issue Solution Note Issue I have a summary of data by month in one sheet and the raw data in another sheet. Instead of creating multiple worksheets for my raw data for each month, I want...
HTML forms ShowForms Interactive forms let web page authors give their pages interactive elements, such as for receiving messages from their readers, much like the reply cards found in some magazines. The reader enters information by filling in fields or clicking...
Graphics cards - Video cards Show2D Accelerator Cards A graphics card, sometimes called a graphics adapter, video card or graphics accelerator, is a computer component which converts digital data into a graphical form which can be displayed on a monitor. The initial role of a...
BinHex encoding ShowBinHex encoding BinHex encoding (a contraction of binary-to-hexadecimal) is a proprietary algorithm owned by Apple for converting 8-bit binary data into a 7-bit format. BinHex encoding, designed for Macintosh systems, is used to preserve file...

1

venkat1926, on Nov 3, 2009 12:57:12 am GMT

Where are the list of names those have to be found or are all the unique names to be consdered?

Reply to venkat1926

2

lostmacro, on Nov 3, 2009 1:39:52 pm GMT
  • +2

Here is what i came up with:
Sub Copy()
Dim DestSheet As Worksheet
Set DestSheet = Worksheets("Sheet2")

Dim sRow As Long
Dim dRow As Long
Dim sCount As Long
sCount = 0
dRow = 1

For sRow = 1 To Range("G75").End(xlUp).Row
If Cells(sRow, "G") Like "*Ehlenfeldt*" Then
sCount = sCount + 1
dRow = dRow + 1
Cells(sRow, "G").Copy Destination:=DestSheet.Cells(dRow, "G")

End If
Next sRow
Sheets("Sheet1").Select
For sRow = 1 To Range("J75").End(xlUp).Row
If Cells(sRow, "J") Like "*Ehlenfeldt*" Then
sCount = sCount + 1
dRow = dRow + 1
Cells(sRow, "G").Copy Destination:=DestSheet.Cells(dRow, "G")
End If
Next sRow
Sheets("Sheet1").Select
For sRow = 1 To Range("G24").End(xlUp).Row
If Cells(sRow, "G") Like "*Tom*" Then
sCount = sCount + 1
dRow = dRow + 1
Cells(sRow, "G").Copy Destination:=DestSheet.Cells(dRow, "G")
End If
Next sRow
MsgBox sCount & " Least Senior copied", vbInformation, "Transfer Done"



End Sub

I need it to continue to look for (unique) names and enter them in order on another sheet. I am looking in G and J columns. I have 200+ names that i need to search for and then enter the top 20 into another worksheet. We need them to be in order of search--it seems to work ok but i will have to copy and write the macro to search for all names wanted 200+. Is there an easier way? Can i eliminate certain names if the are found on the worksheet I'm pasting too? Can i search a different workbook also for more filtering?--so if they are found on another workbook they are not pasted either? Final question--how would i set this macro to run when a button is pushed--basically link it to a button in the worksheet?
Thanks so much---i am new to VB.

Reply to lostmacro

3

 venkat1926, on Nov 4, 2009 2:14:26 am GMT

Your requirement is not clear to me. Do you want the unique names from a list
then use advance filter to get the unique name in the list. I am giving you a trivial example
the data is like thsi from A1 down
heading
a
s
d
f
d
s
a
now highlight these cells clclik data menu-fitler-advancaefilter
in the advance filter window
choose "copy t another location" (at the top)
lit range is already filled up as A1:a8
leave criteria range empty
copy to : some where down the data e.g A15
tick "unique data only " at the bottom
clcik ok

you will get A15down
heading
a
s
d
f

I do not know is this what you want.

Reply to venkat1926