copy/paster to another worksheet

gzell

New Member
Joined
Apr 20, 2019
Messages
37
I am trying to find a code that will copy and paste cells to another worksheet based on other cells value. The cells with value 1_1, 1_2. 1_3, 1_4, 1_5, 1_6, 1_7 1_8, 1_9, 1_9, 1_10, 1_11. 1_12 are the values in column f. These rows would be copy/pasted to another worksheet.


Any help would be greatly appreciated.


spreadsheet

<colgroup><col style="mso-width-source:userset;mso-width-alt:2816;width:58pt" width="77"> <col style="mso-width-source:userset;mso-width-alt:2669;width:55pt" width="73"> <col style="mso-width-source:userset;mso-width-alt:3474;width:71pt" width="95"> <col style="mso-width-source:userset;mso-width-alt:3291;width:68pt" width="90"> <col style="mso-width-source:userset;mso-width-alt:3474;width:71pt" width="95"> <col style="mso-width-source:userset;mso-width-alt:2121;width:44pt" width="58"> <col style="mso-width-source:userset;mso-width-alt:21906;width:449pt" width="599"> </colgroup><tbody>
[TD="class: xl65, width: 77"]1[/TD]
[TD="class: xl65, width: 73"]1[/TD]
[TD="class: xl66, width: 95"]Able[/TD]
[TD="class: xl67, width: 90"]Ezekiel[/TD]
[TD="class: xl67, width: 95"] [/TD]
[TD="class: xl68, width: 58"] [/TD]
[TD="class: xl69, width: 599"] [/TD]

[TD="class: xl65"]2[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl66"]Able[/TD]
[TD="class: xl67"]Ezekiel[/TD]
[TD="class: xl67"] [/TD]
[TD="class: xl68"]1_1[/TD]
[TD="class: xl69, width: 599"]Army: Confederacy[/TD]

[TD="class: xl65"]2[/TD]
[TD="class: xl65"]2[/TD]
[TD="class: xl66"]Able[/TD]
[TD="class: xl67"]Ezekiel[/TD]
[TD="class: xl67"] [/TD]
[TD="class: xl68"]1_2[/TD]
[TD="class: xl69, width: 599"]Location: Texas[/TD]

[TD="class: xl65"]4[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl66"]Able[/TD]
[TD="class: xl67"]Ezekiel[/TD]
[TD="class: xl67"] [/TD]
[TD="class: xl68"]1_3[/TD]
[TD="class: xl69, width: 599"]Regiment: 10th Regiment Texas Infantry (Nelson's)[/TD]

[TD="class: xl65"]5[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl66"]Able[/TD]
[TD="class: xl67"]Ezekiel[/TD]
[TD="class: xl67"] [/TD]
[TD="class: xl68"]1_4[/TD]
[TD="class: xl69, width: 599"]Function: Infantry[/TD]

[TD="class: xl65"]6[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl66"]Able[/TD]
[TD="class: xl67"]Ezekiel[/TD]
[TD="class: xl67"] [/TD]
[TD="class: xl68"]1_5[/TD]
[TD="class: xl69, width: 599"]Company: C[/TD]

[TD="class: xl65"]7[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl66"]Able[/TD]
[TD="class: xl67"]Ezekiel[/TD]
[TD="class: xl67"] [/TD]
[TD="class: xl68"]1_6[/TD]
[TD="class: xl69, width: 599"]Rank: Private[/TD]

[TD="class: xl65"]8[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl66"]Able[/TD]
[TD="class: xl67"]Ezekiel[/TD]
[TD="class: xl67"] [/TD]
[TD="class: xl68"]1_7[/TD]
[TD="class: xl69, width: 599"]Age: --[/TD]

[TD="class: xl65"]9[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl66"]Able[/TD]
[TD="class: xl67"]Ezekiel[/TD]
[TD="class: xl67"] [/TD]
[TD="class: xl68"]1_8[/TD]
[TD="class: xl69, width: 599"]Residence: --[/TD]

[TD="class: xl65"]10[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl66"]Able[/TD]
[TD="class: xl67"]Ezekiel[/TD]
[TD="class: xl67"] [/TD]
[TD="class: xl68"]1_9[/TD]
[TD="class: xl69, width: 599"]Enrolled: Buchanan, Johnson County, Texas [/TD]

[TD="class: xl65"]11[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl66"]Able[/TD]
[TD="class: xl67"]Ezekiel[/TD]
[TD="class: xl67"] [/TD]
[TD="class: xl68"]1_10[/TD]
[TD="class: xl69, width: 599"]Date: October 16, 1861[/TD]

[TD="class: xl65"]12[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl66"]Able[/TD]
[TD="class: xl67"]Ezekiel[/TD]
[TD="class: xl67"] [/TD]
[TD="class: xl68"]1_11[/TD]
[TD="class: xl69, width: 599"]Enlisted: Houston, Texas[/TD]

[TD="class: xl65"]13[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl66"]Able[/TD]
[TD="class: xl67"]Ezekiel[/TD]
[TD="class: xl67"] [/TD]
[TD="class: xl68"]1_12[/TD]
[TD="class: xl69, width: 599"]Date: October 25, 1861[/TD]

[TD="class: xl65"]14[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl66"]Able[/TD]
[TD="class: xl67"]Ezekiel[/TD]
[TD="class: xl67"] [/TD]
[TD="class: xl68"]2_1[/TD]
[TD="class: xl69, width: 599"]Detail: Hospital Nurse[/TD]

[TD="class: xl65"]15[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl66"]Able[/TD]
[TD="class: xl67"]Ezekiel[/TD]
[TD="class: xl67"] [/TD]
[TD="class: xl68"]2_1[/TD]
[TD="class: xl69, width: 599"]Detail: November 8, 1862[/TD]

[TD="class: xl65"]16[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl66"]Able[/TD]
[TD="class: xl67"]Ezekiel[/TD]
[TD="class: xl67"] [/TD]
[TD="class: xl68"]3_1[/TD]
[TD="class: xl69, width: 599"]Relieved of Duty: Nurse[/TD]

[TD="class: xl65"]17[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl66"]Able[/TD]
[TD="class: xl67"]Ezekiel[/TD]
[TD="class: xl67"] [/TD]
[TD="class: xl68"]3_1[/TD]
[TD="class: xl69, width: 599"]Date: February 4, 1862[/TD]

[TD="class: xl65"]18[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl66"]Able[/TD]
[TD="class: xl67"]Ezekiel[/TD]
[TD="class: xl67"] [/TD]
[TD="class: xl68"]4_1[/TD]
[TD="class: xl69, width: 599"]Captured: Battle of Arkansas Post[/TD]

[TD="class: xl65"]19[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl66"]Able[/TD]
[TD="class: xl67"]Ezekiel[/TD]
[TD="class: xl67"] [/TD]
[TD="class: xl68"]4_1[/TD]
[TD="class: xl69, width: 599"]Date: January 11, 1863[/TD]

[TD="class: xl65"]20[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl66"]Able[/TD]
[TD="class: xl67"]Ezekiel[/TD]
[TD="class: xl67"] [/TD]
[TD="class: xl68"]4_2[/TD]
[TD="class: xl69, width: 599"]Forwarded: St. Louis, Missouri via Boats[/TD]

[TD="class: xl65"]21[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl66"]Able[/TD]
[TD="class: xl67"]Ezekiel[/TD]
[TD="class: xl67"] [/TD]
[TD="class: xl68"]4_3[/TD]
[TD="class: xl69, width: 599"]Forwarded: Camp Douglas, Illinois via Rail[/TD]

[TD="class: xl65"]22[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl66"]Able[/TD]
[TD="class: xl67"]Ezekiel[/TD]
[TD="class: xl67"] [/TD]
[TD="class: xl68"]4_4[/TD]
[TD="class: xl69, width: 599"]Prisoner: Camp Douglas, Illinois[/TD]

[TD="class: xl65"]23[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl66"]Able[/TD]
[TD="class: xl67"]Ezekiel[/TD]
[TD="class: xl67"] [/TD]
[TD="class: xl68"]4_5[/TD]
[TD="class: xl69, width: 599"]Died: March 7, 1863[/TD]

[TD="class: xl65"]24[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl66"]Able[/TD]
[TD="class: xl67"]Ezekiel[/TD]
[TD="class: xl67"] [/TD]
[TD="class: xl68"]4_5[/TD]
[TD="class: xl69, width: 599"]Cause: Small Pox[/TD]

[TD="class: xl65"]25[/TD]
[TD="class: xl65"]2[/TD]
[TD="class: xl66"]Adams[/TD]
[TD="class: xl67"]John[/TD]
[TD="class: xl67"]H[/TD]
[TD="class: xl68"] [/TD]
[TD="class: xl69, width: 599"] [/TD]

[TD="class: xl65"]26[/TD]
[TD="class: xl65"]2[/TD]
[TD="class: xl66"]Adams[/TD]
[TD="class: xl67"]John[/TD]
[TD="class: xl67"]H[/TD]
[TD="class: xl68"]1_1[/TD]
[TD="class: xl69, width: 599"]Army: Confederacy[/TD]

[TD="class: xl65"]27[/TD]
[TD="class: xl65"]2[/TD]
[TD="class: xl66"]Adams[/TD]
[TD="class: xl67"]John[/TD]
[TD="class: xl67"]H[/TD]
[TD="class: xl68"]1_2[/TD]
[TD="class: xl69, width: 599"]Location: Texas[/TD]

[TD="class: xl65"]28[/TD]
[TD="class: xl65"]2[/TD]
[TD="class: xl66"]Adams[/TD]
[TD="class: xl67"]John[/TD]
[TD="class: xl67"]H[/TD]
[TD="class: xl68"]1_3[/TD]
[TD="class: xl69, width: 599"]Regiment: 10th Regiment Texas Infantry (Nelson's)[/TD]

[TD="class: xl65"]29[/TD]
[TD="class: xl65"]2[/TD]
[TD="class: xl66"]Adams[/TD]
[TD="class: xl67"]John[/TD]
[TD="class: xl67"]H[/TD]
[TD="class: xl68"]1_4[/TD]
[TD="class: xl69, width: 599"]Function: Infantry[/TD]

[TD="class: xl65"]30[/TD]
[TD="class: xl65"]2[/TD]
[TD="class: xl66"]Adams[/TD]
[TD="class: xl67"]John[/TD]
[TD="class: xl67"]H[/TD]
[TD="class: xl68"]1_5[/TD]
[TD="class: xl69, width: 599"]Company: I[/TD]

[TD="class: xl65"]31[/TD]
[TD="class: xl65"]2[/TD]
[TD="class: xl66"]Adams[/TD]
[TD="class: xl67"]John[/TD]
[TD="class: xl67"]H[/TD]
[TD="class: xl68"]1_6[/TD]
[TD="class: xl69, width: 599"]Rank: Corporal[/TD]

[TD="class: xl65"]32[/TD]
[TD="class: xl65"]2[/TD]
[TD="class: xl66"]Adams[/TD]
[TD="class: xl67"]John[/TD]
[TD="class: xl67"]H[/TD]
[TD="class: xl68"]1_7[/TD]
[TD="class: xl69, width: 599"]Age: 42[/TD]

[TD="class: xl65"]33[/TD]
[TD="class: xl65"]2[/TD]
[TD="class: xl66"]Adams[/TD]
[TD="class: xl67"]John[/TD]
[TD="class: xl67"]H[/TD]
[TD="class: xl68"]1_8[/TD]
[TD="class: xl69, width: 599"]Residence: Johnson County, Texas[/TD]

[TD="class: xl65"]34[/TD]
[TD="class: xl65"]2[/TD]
[TD="class: xl66"]Adams[/TD]
[TD="class: xl67"]John[/TD]
[TD="class: xl67"]H[/TD]
[TD="class: xl68"]1_9[/TD]
[TD="class: xl69, width: 599"]Enlisted: Kimball Texas or Millican, Texas[/TD]

[TD="class: xl65"]35[/TD]
[TD="class: xl65"]2[/TD]
[TD="class: xl66"]Adams[/TD]
[TD="class: xl67"]John[/TD]
[TD="class: xl67"]H[/TD]
[TD="class: xl68"]1_10[/TD]
[TD="class: xl69, width: 599"]Date: January 16, 1862[/TD]

[TD="class: xl65"]36[/TD]
[TD="class: xl65"]2[/TD]
[TD="class: xl66"]Adams[/TD]
[TD="class: xl67"]John[/TD]
[TD="class: xl67"]H[/TD]
[TD="class: xl68"]2_1[/TD]
[TD="class: xl69, width: 599"]Captured: Battle Arkansas Post, Arkansas[/TD]

[TD="class: xl65"]37[/TD]
[TD="class: xl65"]2[/TD]
[TD="class: xl66"]Adams[/TD]
[TD="class: xl67"]John[/TD]
[TD="class: xl67"]H[/TD]
[TD="class: xl68"]2_1[/TD]
[TD="class: xl69, width: 599"]Date: January 11, 1863[/TD]

[TD="class: xl65"]38[/TD]
[TD="class: xl65"]2[/TD]
[TD="class: xl66"]Adams[/TD]
[TD="class: xl67"]John[/TD]
[TD="class: xl67"]H[/TD]
[TD="class: xl68"]2_1[/TD]
[TD="class: xl69, width: 599"]Forwarded: St. Louis, Missouri via Boats[/TD]

[TD="class: xl65"]39[/TD]
[TD="class: xl65"]2[/TD]
[TD="class: xl66"]Adams[/TD]
[TD="class: xl67"]John[/TD]
[TD="class: xl67"]H[/TD]
[TD="class: xl68"]2_1[/TD]
[TD="class: xl69, width: 599"]Forwarded: Camp Douglas, Illinois via Rail[/TD]

</tbody>
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
How about
Code:
Sub gzell()
    With Sheets("[COLOR=#ff0000]Master[/COLOR]")
        .Range("A1:G1").AutoFilter 6, "1_*"
        .AutoFilter.Range.Offset(1).EntireRow.Copy Sheets("[COLOR=#ff0000]Sheet2[/COLOR]").Range("A" & Rows.Count).End(xlUp).Offset(1)
        .AutoFilterMode = False
    End With
End Sub
Change sheet names to suit
 
Upvote 0
Thanks. Worked great. My attempt was far to complicated and the loop did not work. this is good. One additional question. Please let me know if i need to open another thread. I would like to keep name on on first entry but not have them in the other entries. Meaning first entry for each person has the name but is blank until name changes.

Thanks again for the help.
 
Upvote 0
That would need to be another thread, thanks
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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