VBA: Copy specific cells to another worksheet

FatWhale38

New Member
Joined
Nov 2, 2017
Messages
8
Office Version
  1. 2007
Platform
  1. Windows
Dear all

I am having trouble trying to put together a macro.

In Sheet1, I have my data table. I put a simplified version below:

GenderBreedCity CouncilMicrochip Number
Status
MDogCouncil A1030999876287540Adopted
F
DogCouncil C4425588004585700
F
CatCouncil B8735364841765360Adopted
MCatCouncil A3351709516296290

<tbody>
</tbody>

If the animal has been adopted, I need to move the details to Sheet2.

I need to make 3 rows for each entry (one for the family adopting the animal, one for the council and one for our records).

I have to copy the relevant details in to specific cells in Sheet2 ie:
- microchip number to cell K2 (through till K4)
- Council details in L2 (through till L4)
etc.

And then repeat for the next adopted animal.

How do I script the macro to save me from having to copy paste every single row manually?

Many thanks in advance!
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Another thought:

Would it be possible to have in another column, defining say M2 and the macro copies the C2 (ie the council details) to M2 in Sheet2?

Thanks again!
 
Upvote 0

Forum statistics

Threads
1,216,119
Messages
6,128,946
Members
449,480
Latest member
yesitisasport

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