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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Watch MrExcel Video

Forum statistics

Latest member