Copy data from one sheet to another

automatik47

New Member
Joined
Jul 2, 2008
Messages
2
<table x:str="" style="border-collapse: collapse; width: 530px; height: 144px;" border="0" cellpadding="0" cellspacing="0"><col style="width: 48pt;" width="64"> <col style="width: 50pt;" span="3" width="66"> <col style="width: 50pt;" width="66"> <col style="width: 50pt;" width="66"> <col style="width: 50pt;" width="67"> <col style="width: 50pt;" width="66"> <tbody><tr style="height: 12.75pt;" height="17"> <td class="xl32" style="height: 12.75pt; width: 48pt;" width="64" height="17">Apples</td> <td class="xl30" style="width: 50pt;" x:num="1" width="66"> 1 </td> <td class="xl30" style="border-left: medium none; width: 50pt;" x:num="1" width="66"> 1 </td> <td class="xl30" style="border-left: medium none; width: 50pt;" x:num="1" width="66"> 1 </td> <td class="xl30" style="border-left: medium none; width: 50pt;" x:num="2" width="66"> 2 </td> <td class="xl30" style="border-left: medium none; width: 50pt;" x:num="2" width="66"> 2 </td> <td class="xl30" style="border-left: medium none; width: 50pt;" x:num="0" width="67"> - </td> <td class="xl30" style="border-left: medium none; width: 50pt;" x:num="1" width="66"> 1 </td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl32" style="height: 12.75pt;" height="17">Oranges</td> <td class="xl31" style="border-top: medium none;" x:num="9"> 9 </td> <td class="xl31" style="border-top: medium none; border-left: medium none;" x:num="7"> 7 </td> <td class="xl31" style="border-top: medium none; border-left: medium none;" x:num="7"> 7 </td> <td class="xl31" style="border-top: medium none; border-left: medium none;" x:num="10"> 10 </td> <td class="xl31" style="border-top: medium none; border-left: medium none;" x:num="8"> 8 </td> <td class="xl31" style="border-top: medium none; border-left: medium none;" x:num="7"> 7 </td> <td class="xl31" style="border-top: medium none; border-left: medium none;" x:num="7"> 7 </td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl32" style="height: 12.75pt;" height="17">Mangos</td> <td class="xl30" style="border-top: medium none;" x:num="17"> 17 </td> <td class="xl30" style="border-top: medium none; border-left: medium none;" x:num="13"> 13 </td> <td class="xl30" style="border-top: medium none; border-left: medium none;" x:num="13"> 13 </td> <td class="xl30" style="border-top: medium none; border-left: medium none;" x:num="18"> 18 </td> <td class="xl30" style="border-top: medium none; border-left: medium none;" x:num="14"> 14 </td> <td class="xl30" style="border-top: medium none; border-left: medium none;" x:num="14"> 14 </td> <td class="xl30" style="border-top: medium none; border-left: medium none;" x:num="13"> 13 </td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl32" style="height: 12.75pt;" height="17">Donkies</td> <td class="xl31" style="border-top: medium none;" x:num="25"> 25 </td> <td class="xl31" style="border-top: medium none; border-left: medium none;" x:num="19"> 19 </td> <td class="xl31" style="border-top: medium none; border-left: medium none;" x:num="19"> 19 </td> <td class="xl31" style="border-top: medium none; border-left: medium none;" x:num="26"> 26 </td> <td class="xl31" style="border-top: medium none; border-left: medium none;" x:num="20"> 20 </td> <td class="xl31" style="border-top: medium none; border-left: medium none;" x:num="21"> 21 </td> <td class="xl31" style="border-top: medium none; border-left: medium none;" x:num="19"> 19
</td> </tr> </tbody></table>This is the data i have on one sheet 1 per say. On sheet 2 I have

Apples
Oranges
Mangos
Donkies

I need all the numbers copied to sheet 2 from sheet 1 and look exactly like sheet 1. I am dealing with huge amount of data and I need a find and copy function. I have a very minimal knowledge of VBA so any code will be helpful...Thank you very much
 
Last edited:

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
do you just want to make exact copy of sheet 1 t sheet 2 even though the fruit names are there in sheet 2.

then try this macro
Code:
Sub test()
With Worksheets("sheet1")
.UsedRange.Copy
With Worksheets("sheet2")
.Range("a1").PasteSpecial
End With 'sheet2
End With 'sheet1
End Sub
{/code]

But this looks too trivial and I think I have not understood.
 
Upvote 0
the data I have on sheet one needs to be copied to sheet 2 matching the fruit names with the click of a button.

The fruit names are jumbled up in sheet 2 i.e they are not in the same order as sheet 1

So I want some code that would find the fruit name in sheet 2 and copy the respective data from sheet 1

Hope this clarifies if not I am willing to pm my excel file to anyone who requests it...thank you for the help
 
Upvote 0
Perhaps I have not understood. Even if the fruits names in sheet 2 are not in the same order as in sheet 1 even then you can delete the entries in sheet 2 and copy sheet 1 to sheet2 UNLESS THE ORDER OF FRUITS IN SHEET2 IS IMPORTANT.

If it is so you use vlookup formula in sheet 2 with refrence to sheet 1. see help for "vlookup" in excel help.

you try this. see thes sheet(sheet 2) below and the formula in B2 (sheet2).copy B2 down and to the right. do you get what you want.
Book1
ABCDEFGH
1fruith1h2h3h4h5h6h7
2Apples11122-1
3Oranges97710877
4Mangos17131318141413
5Donkies2519192620211
Sheet2
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,251
Members
448,556
Latest member
peterhess2002

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top