Create VBA code - Inserting a row in other worksheets based on meeting a criteria


New Member
Jul 25, 2020
Office Version
  1. 365
  1. Windows
Hi Guys,

Am a novice when it comes to VBA, generally find the codes i need from google but cannot find one that helps me this time.

I will try my best to describe what the file is doing and what i am trying to achieve.

The file has a series of worksheets (Parent Projects), with each containing a list of children projects and the data relating to them. The data for these projects is pulled in via a formula from other worksheets (where the reports are dumped in). I have a formula in one of the worksheets (call it Worksheet1) that in column X will have a 0 next to the project if it is missing from its Parent Project worksheet.

I am hoping to be able to create a code that will identify what project is missing (from worksheet1), do a vlookup on the parent project number to know what worksheet to add it to, insert a row (say row 100), Copy and paste the formulas from the row above, copy and paste the child project number (say to column C) and then run the code again until there are no more 0's in column X. (all the missing children projects have been added to their parent project worksheet)

Also, if possible i would like to run this macro from a seperate workbook, if not, its not a big deal.

Hope what i am trying to achieve makes sense, if not i can try and clarify any queries.


Some videos you may like

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

Watch MrExcel Video

Forum statistics

Latest member