PDA

View Full Version : VBA copy and paste with criteria and different sheets



sokour
10-24-2018, 02:33 AM
Hello everyone,


I am a beginner in VBA and I try to learn because I have a lot of reporting that I would like to automate.


I would like to know if it is possible to help me on the construction of a macro.


For a reporting, I import the data that will be on the sheet "source data".
I would now like to take the data and put it according to criteria on the "control" sheet.
So first in "Source Data", I only select the lines or appear "103" in column A:
- I copy all the data from the sheet "Source data" and sheet "total" to the sheet "Control" and start from box C10 and continue until all lines 103 have not been all copy glue .
Column C ("Source data") to / from "C10" ("Control").
Column E ("Source data") to / from "D10" ("Control").
Column M ("Source data") to / from "E10" ("Control").
Column M ("Source data") to / from "E10" ("Control").
Column I ("Total") to / from "G10" ("Control").
Column R ("Source data") to / from "H10" ("Control").
Column T ("Source data") to / from "I10" ("Control").
Q column ("Source data") to / from "J10" ("Control").
"K10" = ((H10 * G10) / 100) / I10
"L10" = ((J10-K10) / J10) - Set Percent.
Column F ("Control") from F10 = according to D10 (code) we will go to column B ("total") and if ya match we take the result in column C (name).
We redo and copied to the last line where there are 103 in the sheet "Donnee Source".


I left 2 lines in the "control" sheet to show the result.
23080
Thank you so much !