Inserting rows under specific types of data.

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

I have a Bill Of Materials (BOM) represented in excel,
each row representing a line in the BOM. The BOM is made
up of assemblies, sub-assemblies and components.

Are there any functions in excel that can search down the
BOM and insert a row under every Component but not sub-
assemblies and assemblies so that Material can then be
added.

Kind regards
Dan.
 
Dan,

quick and dirty, use the subtotal functionality with
count as the function used. this will provide a count row
on component, breaking the list, and providing sum useful
information (I think). You can then insert rows and add
the materials.

Alternatively, you could use a macro such as

Sub Add_Line_under_Component()

range("A2").select 'assumes component in column A
restart:
Comp=activecell.value
do until activecell.value<> Comp
activecell.offset(1,0).select
Loop
selection.entirerow.insert
activecell.offset(1,0).select
If activecell.value<> "" then goto restart
end sub

This is untested, and may not work, but will get you
started.

Steve
 
Back
Top