Macro Code for searching and pasting to another worksheet

AF1987

New Member
Joined
Oct 11, 2017
Messages
1
Hi

Really new to VBA and Macro's so any help would be much appreciated :eek:

I have a spreadsheet that contains data that needs to be pasted to a different worksheet depending on cell value.

For instance:

Cash NetCASH VatCASH Gross
22.50
7.50
385.20
6.990
<colgroup><col width="116" style="width: 87pt; mso-width-source: userset; mso-width-alt: 4242;"> <col width="82" style="width: 62pt; mso-width-source: userset; mso-width-alt: 2998;"> <col width="77" style="width: 58pt; mso-width-source: userset; mso-width-alt: 2816;"> <tbody> </tbody>

I need to code to search the worksheet for Cash Net, Cash Vat, Cash Gross and if found paste the cells directly below it into specific cells in a new worksheet.

I can do this using the Macro recorder but...

The work sheet in question may not ALWAYS contain Cash Net, Cash Vat or Cash Gross. And sometimes the values might be found in different cells. So basically, if the worksheet does not contain Cash Net, I need it to ignore that and move onto searching for Cash Vat. Cash Net maybe in cell A1 (for instance) in one sheet but A4 in another sheet.

Any help on this would be fantastic and give me a great start on my project.

Thanks,
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Forum statistics

Threads
1,214,826
Messages
6,121,795
Members
449,048
Latest member
greyangel23

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