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
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: