VBA code to find match then copy and paste values

Energizey

New Member
Joined
Oct 3, 2018
Messages
1
Hi everyone,

I am very new to VBA - have a beginners course in a few weeks which I amlooking forward to! But in the interim I am working on some finance models andwould be really grateful for the VBA coding help to I can keep progessing.

I am using one Workbook. I need to copy and paste values from a range of cellsin one worksheet to another if a match is found. I have a Sales Calculatorworksheet where the user chooses a product and then sets some parameters tocalculate sales budget. The results are displayed in rows 19-29 of SalesCalculator worksheet to form the monthly budgets. The budget figures then needto be pasted to a Budget worksheet, once this is done the user can select thenext product on Sales Calculator and set budget for that product. Each producthas sub products so depending on the product selected there may be between 1 to10 rows of budget figures which values need to be copied from Sales Calculatorto Budget worksheet at a time.

- When a product is selected in Sales Calculator Worksheet a list of GeneralLedger Codes will populate in cells E19:E29.
- I want to look for an exact match to each General Ledger Code in the BudgetWorksheet cells A4:A55.
- If exact match is found I want to copy the values in Sales CalculatorWorksheet Range F19:E29 (which are the 12 months budget figures) and pastevalues to the row where the General Ledger code match is found in BudgetWorksheet columns F to Q.

This process needs to be run for each product, so I need the values that havealready been pasted to Budget Worksheet to stay in place.

I also need to be able to run the function again if the budget needs to bechanged, so would be useful to have a warning if values already exist in thedestination cells to confirm replace with new values.

Thanks in advance
 
Last edited by a moderator:

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Forum statistics

Threads
1,224,823
Messages
6,181,177
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