SlideShare uma empresa Scribd logo
1 de 6
HOW TO BUILD A DOCUMENT REPOSITORY WITH EXCEL
Michael Brothers
In 2016 I builta documentrepositoryfora manufacturingclientinDanvers,Massachusetts.The companyproduces
bioreactorassembliesmade fromalotof plastictubingandparts.On a regularbasiscustomerswouldrequesta
certificate of animal origin,allergens,etc.inthe material composition,whichnecessarilytracedbackto supplier
components.Myrole wasto collectall of the suppliercertificatesinacentral serverlocation,andmake themeasily
retrievable.
Imagine acompanythat makesfabricdolls.They make all differentshapesandsizesof doll,butthe raw materialsare
typicallyfabric,yarn,thread,stuffingandbuttons.Sowe have five suppliers(FabricCo,YarnCo,etc.) andeachsupplier
offersdozensof variationsof theirproduct.Eachdoll thatthe companyproduceswill have aBill of Materialsspecificto
that doll – a particularcut of fabric,a certaincolor yarn,etc.
Whena customerordersa doll,theyaskif the doll containspeanutsorlatex.Anothercustomerasksaboutbovine
tallow.A thirdhas carbonfootprintconcerns.Inresponse,ourcompanydevelopsaMaterial of CompositionCertificate
(we’ll call itaMOCC) that theysendtoall theirsuppliers.The MOCCasksa setof questionsthataddressthe dozenorso
mostcommon customerconcerns. Overthe years,the MOCC haschangedto addressnewerdemands.Soinourfile
systemwe have three versionsof the MOCCform;MOCC1, MOCC2 and MOCC3. Theyare similarexceptthatthe order
of the questionsisdifferentineachform,andMOCC3 askstwo new questionsthatare noton MOCC1 or MOCC2.
So howdo we buildasystemthat allowsustotake a doll’sBill of Materials,andautomaticallyanswerquestionsbased
on supplierMOCCforms? The followingsectionsoutline mysolutiontothe problem.
Step 1: File Folders.....................................................................................................................................................2
Step 2: Part Number Worksheet.................................................................................................................................2
Step 3: Hyperlinks......................................................................................................................................................2
Step 4: Questionnaire Fields.......................................................................................................................................3
Step 5: Conditional Formatting...................................................................................................................................4
Step 6: Performing Lookups........................................................................................................................................5
Step 7: Simplify Matters with a Macro ........................................................................................................................6
Step 1: File Folders
Each supplierisassignedafolderonthe networkdrive.Supplierfoldersholdthreesubfolders;“FormsSent”,“Forms
Current”and “FormsOutdated”. Inthe data collectionphase of the project,all supplierformsare scannedaspdf files
and putintothe appropriate folder.
Suppliers
FabricCo
FormsCurrent
GGparts signed.pdf
FormsOutdated
FormsSent
GGparts.pdf
ThreadCo
YarnCo
Step 2: Part NumberWorksheet
The nextstepisto create a spreadsheettoholdindividual components,eachwithaunique partnumber:
The firstthree rowsare intentionallyleftblank –thiswill helpaddressthe differentMOCCversionslateron.
Step 3: Hyperlinks
Assume we have MOCCformsfor everypart.The easysolutionistoadda hyperlinktothe partnumbercell thatpoints
to the properfile.DON’T!Ifoundoutthe hard way that hyperlinks(like cellborders) don’ttravel whenthe spreadsheet
issorted.Instead,use the HYPERLINKfunction:
=HYPERLINK(“filepathfilename”, “text to appear in cell”)
Thisprovidesapermanentlink,andsome newoptions.
For example,inmyspreadsheetIusedthe hyperlinktoindicatewhichversionof aformwe hadon file.
If the MOCC for YarnCo’smerinowool productsisversion2,I mighthave
=HYPERLINK(“YarnCoForms%20ReceivedGGparts%20signed.pdf”,“2”)
Here, %20 standsin place of a space character – depending on youroperating systemyou may notneed it.
Thisway,I can easilyselectall partswitholderMOCCversionsandsendrequeststothe supplierforupdatedforms.
Step 4: Questionnaire Fields
Next,create columnsforeachquestion.Thenmapthe questionnaireversionstothe questionsusingthe thre e rows
reservedatthe top of the sheet.
Here,column E contains linkstoMOCC files,withtextindicatingwhichversionisonfile.
ColumnsFthroughJ holdanswersto surveyquestions.Note thatrightnow,these columnsare sortedbyrow3
– that is,theyappearinMOCC3 order.Before enteringabatch of MOCC2 forms,we couldsort byRow 2:
SelectcolumnsF:H,open CustomSort,unselect“Mydata has headers”,choose Options, select“Sortlefttoright”:
Step 5: Conditional Formatting
Take advantage of conditional formattingtohighlight“Yes”responsesincertaincategories:
Note:thisispurelycosmetic,anddoesnotaffectanyof the values.
Step 6: PerformingLookups
Assume thatour spreadsheetnowcontainsdozensof suppliersandthousandsof parts.It’stime to putthemto work!
Opena newtab, call itPart NumberLookup,andcreate columnsfor the categoriesyoucare about.
In the projectI completed forthe biotechfirm,the Bill of Materialswascopiedfromamanufacturingdrawinginpdf.
As such,the quantity,descriptionandpartnumberall appearedonone line.Fortunately,the partnumberwasalways
the last wordof text.The followingline of code letme stripjustthe part numberintoitsowncell:
=RIGHT(A2,LEN(A2)-FIND("|",SUBSTITUTE(A2," ","|",LEN(A2)-LEN(SUBSTITUTE(A2," ","")))))
Thiscounts all the spacesinthe string,turnsthe lastone intoa vertical pipe,andthengrabstextto the rightof the pipe.
Usingthe VLOOKUPfunctionorINDEX/MATCHisyour choice.If usingVLOOKUP,be sure to add the FALSEargument,
while MATCHshouldinclude the 0argument.These argumentspreventfalse returnsif apartnumberisnot listed,and
don’trequire thatpart numbersbe sorted.IpreferINDEX/MATCH:
Sheet1ColumnFcorrespondstothe Peanutsquestion. Takecarenotto rearrangetheSheet1 columns!
The lookupformulawill grabdatafrom columnFno matterwhichquestionisassignedthere.
I got aroundthisby settingaside asmall group of columns overto the right of the questionnairecolumns.TheseI
devotedtokeyquestionslike peanutsandlatex.While itaddedabitto data entry,itallowedme tosort the
questionnaire columnsfreely. Italsogave me a place to record data obtained fromsourcesbesidesthe questionnaire.
Anotherworkaroundwouldbe to copythe INDEX/MATCHformulaintocell C1 – thatis, topull the columnheadingfrom
Sheet1ColumnFby matching onthe phrase “Part Number”.
Step 7: SimplifyMatters with a Macro
As itstands,performingalookuprequiresfirstpastingthe Bill of Materials,thenselectingthe formularowsfrom
somewhere andfinallypastingthemintothe appropriate spot.Thiscanall be done inone stepwitha VBA macro.
First,decide where youwouldlike tostore the lookupformulas.Theyshouldbe inaplace that isaccessible tothe
macro, and unlikelytobe deletedbythe user.Ikeptmine ona separate tab, buthere I’ll putthemintothe first row of
the lookuptab.Aftermakingsure the macro worksproperly,I’dhide the row fromview.
Hit Alt-F11to openthe VB editorinExcel,openanew module,andtype the followingcode:
Sub PasteBoM()
‘ First make sure the ActiveCell is in the right column
If ActiveCell.column <> 1 Then
MsgBox(“Please select a cell in Column A and try again.”
Exit Sub
End If
‘ Then make sure the neighborhood 100 rows down and 4 columns right is clear
If WorksheetFunction.CountA(Range(ActiveCell, _
ActiveCell.Offset(100,4))) > 0 Then
Box = MsgBox(“You might be pasting new data on top of old data. _
Do you wish to continue?”, vbYesNo, “DANGER: Potential Loss of Data!”)
Select Case box
Case vbNo
Exit Sub
End Select
End If
‘ Paste the BoM from the clipboard, then the formulas
Selection.PasteSpecial (xlPasteAll)
Range(“b1:e1”).Copy Selection.Offset(0,1)
End Sub
I assigned“Ctrl-j”tothe macro. It shouldbe notedthatmacros cannotbe reversed –that is,Ctrl-zdoesn’twork.
That is whyI included the neighborhoodchecktoensure dataisnot unintentionallydeleted.
Conclusion
That’s it!Nowwe have an orderlyfilingsystem,apartslibrarythat pointstorelevantfiles,andameansto lookup
meaningful datafromaBill of Materials.
One final note.Inthe Lookupsection,INDEX/MATCHbroughtoverthe cell value –that is,the “Yes” or “No”.
If I’d wantedtosee the file pathinstead,Iwouldhave tolookinside the HYPERLINKfunction.
Say that the parts spreadsheethadthe followingentryincolumnEforpart numberGG1468:
=HYPERLINK("SuppliersFabricCoForms CurrentGGparts signed.pdf","2")
The file pathcan be obtainedwithtwoformulas:
=FORMULATEXT(INDEX(Sheet1!E:E,MATCH($B2,Sheet1!$A:$A,0)))
Returns
=HYPERLINK("SuppliersFabricCoFormsCurrentGGpartssigned.pdf","2")
So then
=MID(F2,13,LEN(F2)-18)
Returns
SuppliersFabricCoFormsCurrentGGpartssigned.pdf
Voila!

Mais conteúdo relacionado

Mais procurados

Lfa problem tree analysis
Lfa   problem tree analysisLfa   problem tree analysis
Lfa problem tree analysis
Liris Thomas
 
Project, Program & Portfolio Management
Project, Program & Portfolio ManagementProject, Program & Portfolio Management
Project, Program & Portfolio Management
Anand Subramaniam
 

Mais procurados (10)

Lfa problem tree analysis
Lfa   problem tree analysisLfa   problem tree analysis
Lfa problem tree analysis
 
Embedding RCSA into Strategic Planning and Business Strategy
Embedding RCSA into Strategic Planning and Business StrategyEmbedding RCSA into Strategic Planning and Business Strategy
Embedding RCSA into Strategic Planning and Business Strategy
 
Operations Management PPT RVU 2022.ppt
Operations Management  PPT RVU   2022.pptOperations Management  PPT RVU   2022.ppt
Operations Management PPT RVU 2022.ppt
 
Organizational network analysis and agent-based modeling
Organizational network analysis and agent-based modelingOrganizational network analysis and agent-based modeling
Organizational network analysis and agent-based modeling
 
AI in Project Management.pdf
AI in Project Management.pdfAI in Project Management.pdf
AI in Project Management.pdf
 
Setting up Filters & Layouts in P6
Setting up Filters & Layouts in P6Setting up Filters & Layouts in P6
Setting up Filters & Layouts in P6
 
Timesaver ppt jk
Timesaver ppt jkTimesaver ppt jk
Timesaver ppt jk
 
88 m&e interview questions and answers
88 m&e interview questions and answers88 m&e interview questions and answers
88 m&e interview questions and answers
 
Project, Program & Portfolio Management
Project, Program & Portfolio ManagementProject, Program & Portfolio Management
Project, Program & Portfolio Management
 
Project management-CH 4
Project management-CH 4Project management-CH 4
Project management-CH 4
 

Destaque

Drogas - Catarina
Drogas - CatarinaDrogas - Catarina
Drogas - Catarina
blog-eic
 
Primeiras sociedades recoletoras blogue
Primeiras sociedades recoletoras bloguePrimeiras sociedades recoletoras blogue
Primeiras sociedades recoletoras blogue
Vítor Santos
 
#eLKaravan diploma Infostud
#eLKaravan diploma Infostud#eLKaravan diploma Infostud
#eLKaravan diploma Infostud
Limundo
 
Os Três Reis Magos
Os Três Reis Magos Os Três Reis Magos
Os Três Reis Magos
blog-eic
 

Destaque (20)

Drogas - Catarina
Drogas - CatarinaDrogas - Catarina
Drogas - Catarina
 
Holt Retail Space for Lease in Pomona CA
Holt Retail Space for Lease in Pomona CAHolt Retail Space for Lease in Pomona CA
Holt Retail Space for Lease in Pomona CA
 
Doc1
Doc1Doc1
Doc1
 
"Somos Físicos" Corrupção e Petróleo
"Somos Físicos" Corrupção e Petróleo"Somos Físicos" Corrupção e Petróleo
"Somos Físicos" Corrupção e Petróleo
 
1 results coupe-de-kayl-2016
1 results coupe-de-kayl-20161 results coupe-de-kayl-2016
1 results coupe-de-kayl-2016
 
"Abstenção" por Isabel Magalhães
"Abstenção" por Isabel Magalhães"Abstenção" por Isabel Magalhães
"Abstenção" por Isabel Magalhães
 
Um toque de magia 2017
Um toque de magia 2017Um toque de magia 2017
Um toque de magia 2017
 
Actividad fitotóxica de los extractos de chile manzano (capsicum pubescens r ...
Actividad fitotóxica de los extractos de chile manzano (capsicum pubescens r ...Actividad fitotóxica de los extractos de chile manzano (capsicum pubescens r ...
Actividad fitotóxica de los extractos de chile manzano (capsicum pubescens r ...
 
Primeiras sociedades recoletoras blogue
Primeiras sociedades recoletoras bloguePrimeiras sociedades recoletoras blogue
Primeiras sociedades recoletoras blogue
 
Inmuebles, inversiones e intangibles
Inmuebles, inversiones e intangiblesInmuebles, inversiones e intangibles
Inmuebles, inversiones e intangibles
 
Alcácer do Sal por João Aníbal Henriques
Alcácer do Sal por João Aníbal HenriquesAlcácer do Sal por João Aníbal Henriques
Alcácer do Sal por João Aníbal Henriques
 
Nazaré publicado
Nazaré   publicadoNazaré   publicado
Nazaré publicado
 
#eLKaravan diploma Infostud
#eLKaravan diploma Infostud#eLKaravan diploma Infostud
#eLKaravan diploma Infostud
 
Os Três Reis Magos
Os Três Reis Magos Os Três Reis Magos
Os Três Reis Magos
 
Revista Fundação Cascais - Setembro 2001
Revista Fundação Cascais - Setembro 2001Revista Fundação Cascais - Setembro 2001
Revista Fundação Cascais - Setembro 2001
 
04 pintura barroca
04 pintura barroca04 pintura barroca
04 pintura barroca
 
02 arquitetura barroca
02 arquitetura barroca02 arquitetura barroca
02 arquitetura barroca
 
Conde Da Ericeira
Conde Da EriceiraConde Da Ericeira
Conde Da Ericeira
 
Paises da europa rafael resende e joao pedro 7 e
Paises da europa rafael resende e joao pedro 7 ePaises da europa rafael resende e joao pedro 7 e
Paises da europa rafael resende e joao pedro 7 e
 
Bengal gram
Bengal gramBengal gram
Bengal gram
 

Semelhante a How to Build a Document Repository with Excel

IT 511 Final Project Guidelines and Grading Guide Ov.docx
IT 511 Final Project Guidelines and Grading Guide  Ov.docxIT 511 Final Project Guidelines and Grading Guide  Ov.docx
IT 511 Final Project Guidelines and Grading Guide Ov.docx
priestmanmable
 
Assignment2 A
Assignment2 AAssignment2 A
Assignment2 A
Mahmoud
 
Cis247 a ilab 3 overloaded methods and static methods variables
Cis247 a ilab 3 overloaded methods and static methods variablesCis247 a ilab 3 overloaded methods and static methods variables
Cis247 a ilab 3 overloaded methods and static methods variables
ccis224477
 
Simulink Presentation.ppt
Simulink Presentation.pptSimulink Presentation.ppt
Simulink Presentation.ppt
hodeeeeee1
 
Cis247 a ilab 3 overloaded methods and static methods variables
Cis247 a ilab 3 overloaded methods and static methods variablesCis247 a ilab 3 overloaded methods and static methods variables
Cis247 a ilab 3 overloaded methods and static methods variables
cis247
 
Cis247 i lab 3 overloaded methods and static methods variables
Cis247 i lab 3 overloaded methods and static methods variablesCis247 i lab 3 overloaded methods and static methods variables
Cis247 i lab 3 overloaded methods and static methods variables
sdjdskjd9097
 

Semelhante a How to Build a Document Repository with Excel (20)

MS Access Macros
MS Access MacrosMS Access Macros
MS Access Macros
 
VBA
VBAVBA
VBA
 
IT 511 Final Project Guidelines and Grading Guide Ov.docx
IT 511 Final Project Guidelines and Grading Guide  Ov.docxIT 511 Final Project Guidelines and Grading Guide  Ov.docx
IT 511 Final Project Guidelines and Grading Guide Ov.docx
 
MACROS excel
MACROS excelMACROS excel
MACROS excel
 
Tutorials v10
Tutorials v10Tutorials v10
Tutorials v10
 
How to use vlookup in MS Excel
How to use vlookup in MS ExcelHow to use vlookup in MS Excel
How to use vlookup in MS Excel
 
Assignment2 A
Assignment2 AAssignment2 A
Assignment2 A
 
Vba and macro creation (using excel)
Vba and macro creation (using excel)Vba and macro creation (using excel)
Vba and macro creation (using excel)
 
Java script basics
Java script basicsJava script basics
Java script basics
 
Cis247 a ilab 3 overloaded methods and static methods variables
Cis247 a ilab 3 overloaded methods and static methods variablesCis247 a ilab 3 overloaded methods and static methods variables
Cis247 a ilab 3 overloaded methods and static methods variables
 
Simulink Presentation.ppt
Simulink Presentation.pptSimulink Presentation.ppt
Simulink Presentation.ppt
 
Tutorials on Macro
Tutorials on MacroTutorials on Macro
Tutorials on Macro
 
Cis247 a ilab 3 overloaded methods and static methods variables
Cis247 a ilab 3 overloaded methods and static methods variablesCis247 a ilab 3 overloaded methods and static methods variables
Cis247 a ilab 3 overloaded methods and static methods variables
 
Manual de macros en calc
Manual de macros en calcManual de macros en calc
Manual de macros en calc
 
Useful macros and functions for excel
Useful macros and functions for excelUseful macros and functions for excel
Useful macros and functions for excel
 
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISPMCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
 
Excel Vba Basic Tutorial 1
Excel Vba Basic Tutorial 1Excel Vba Basic Tutorial 1
Excel Vba Basic Tutorial 1
 
Cis247 i lab 3 overloaded methods and static methods variables
Cis247 i lab 3 overloaded methods and static methods variablesCis247 i lab 3 overloaded methods and static methods variables
Cis247 i lab 3 overloaded methods and static methods variables
 
Well You Ought To Know (WYOTK) FP&A Automation Series
Well You Ought To Know (WYOTK) FP&A Automation SeriesWell You Ought To Know (WYOTK) FP&A Automation Series
Well You Ought To Know (WYOTK) FP&A Automation Series
 
All My X’s Come From Texas...Not!!
All My X’s Come From Texas...Not!!All My X’s Come From Texas...Not!!
All My X’s Come From Texas...Not!!
 

How to Build a Document Repository with Excel

  • 1. HOW TO BUILD A DOCUMENT REPOSITORY WITH EXCEL Michael Brothers In 2016 I builta documentrepositoryfora manufacturingclientinDanvers,Massachusetts.The companyproduces bioreactorassembliesmade fromalotof plastictubingandparts.On a regularbasiscustomerswouldrequesta certificate of animal origin,allergens,etc.inthe material composition,whichnecessarilytracedbackto supplier components.Myrole wasto collectall of the suppliercertificatesinacentral serverlocation,andmake themeasily retrievable. Imagine acompanythat makesfabricdolls.They make all differentshapesandsizesof doll,butthe raw materialsare typicallyfabric,yarn,thread,stuffingandbuttons.Sowe have five suppliers(FabricCo,YarnCo,etc.) andeachsupplier offersdozensof variationsof theirproduct.Eachdoll thatthe companyproduceswill have aBill of Materialsspecificto that doll – a particularcut of fabric,a certaincolor yarn,etc. Whena customerordersa doll,theyaskif the doll containspeanutsorlatex.Anothercustomerasksaboutbovine tallow.A thirdhas carbonfootprintconcerns.Inresponse,ourcompanydevelopsaMaterial of CompositionCertificate (we’ll call itaMOCC) that theysendtoall theirsuppliers.The MOCCasksa setof questionsthataddressthe dozenorso mostcommon customerconcerns. Overthe years,the MOCC haschangedto addressnewerdemands.Soinourfile systemwe have three versionsof the MOCCform;MOCC1, MOCC2 and MOCC3. Theyare similarexceptthatthe order of the questionsisdifferentineachform,andMOCC3 askstwo new questionsthatare noton MOCC1 or MOCC2. So howdo we buildasystemthat allowsustotake a doll’sBill of Materials,andautomaticallyanswerquestionsbased on supplierMOCCforms? The followingsectionsoutline mysolutiontothe problem. Step 1: File Folders.....................................................................................................................................................2 Step 2: Part Number Worksheet.................................................................................................................................2 Step 3: Hyperlinks......................................................................................................................................................2 Step 4: Questionnaire Fields.......................................................................................................................................3 Step 5: Conditional Formatting...................................................................................................................................4 Step 6: Performing Lookups........................................................................................................................................5 Step 7: Simplify Matters with a Macro ........................................................................................................................6
  • 2. Step 1: File Folders Each supplierisassignedafolderonthe networkdrive.Supplierfoldersholdthreesubfolders;“FormsSent”,“Forms Current”and “FormsOutdated”. Inthe data collectionphase of the project,all supplierformsare scannedaspdf files and putintothe appropriate folder. Suppliers FabricCo FormsCurrent GGparts signed.pdf FormsOutdated FormsSent GGparts.pdf ThreadCo YarnCo Step 2: Part NumberWorksheet The nextstepisto create a spreadsheettoholdindividual components,eachwithaunique partnumber: The firstthree rowsare intentionallyleftblank –thiswill helpaddressthe differentMOCCversionslateron. Step 3: Hyperlinks Assume we have MOCCformsfor everypart.The easysolutionistoadda hyperlinktothe partnumbercell thatpoints to the properfile.DON’T!Ifoundoutthe hard way that hyperlinks(like cellborders) don’ttravel whenthe spreadsheet issorted.Instead,use the HYPERLINKfunction: =HYPERLINK(“filepathfilename”, “text to appear in cell”) Thisprovidesapermanentlink,andsome newoptions. For example,inmyspreadsheetIusedthe hyperlinktoindicatewhichversionof aformwe hadon file. If the MOCC for YarnCo’smerinowool productsisversion2,I mighthave =HYPERLINK(“YarnCoForms%20ReceivedGGparts%20signed.pdf”,“2”) Here, %20 standsin place of a space character – depending on youroperating systemyou may notneed it. Thisway,I can easilyselectall partswitholderMOCCversionsandsendrequeststothe supplierforupdatedforms.
  • 3. Step 4: Questionnaire Fields Next,create columnsforeachquestion.Thenmapthe questionnaireversionstothe questionsusingthe thre e rows reservedatthe top of the sheet. Here,column E contains linkstoMOCC files,withtextindicatingwhichversionisonfile. ColumnsFthroughJ holdanswersto surveyquestions.Note thatrightnow,these columnsare sortedbyrow3 – that is,theyappearinMOCC3 order.Before enteringabatch of MOCC2 forms,we couldsort byRow 2: SelectcolumnsF:H,open CustomSort,unselect“Mydata has headers”,choose Options, select“Sortlefttoright”:
  • 4. Step 5: Conditional Formatting Take advantage of conditional formattingtohighlight“Yes”responsesincertaincategories: Note:thisispurelycosmetic,anddoesnotaffectanyof the values.
  • 5. Step 6: PerformingLookups Assume thatour spreadsheetnowcontainsdozensof suppliersandthousandsof parts.It’stime to putthemto work! Opena newtab, call itPart NumberLookup,andcreate columnsfor the categoriesyoucare about. In the projectI completed forthe biotechfirm,the Bill of Materialswascopiedfromamanufacturingdrawinginpdf. As such,the quantity,descriptionandpartnumberall appearedonone line.Fortunately,the partnumberwasalways the last wordof text.The followingline of code letme stripjustthe part numberintoitsowncell: =RIGHT(A2,LEN(A2)-FIND("|",SUBSTITUTE(A2," ","|",LEN(A2)-LEN(SUBSTITUTE(A2," ",""))))) Thiscounts all the spacesinthe string,turnsthe lastone intoa vertical pipe,andthengrabstextto the rightof the pipe. Usingthe VLOOKUPfunctionorINDEX/MATCHisyour choice.If usingVLOOKUP,be sure to add the FALSEargument, while MATCHshouldinclude the 0argument.These argumentspreventfalse returnsif apartnumberisnot listed,and don’trequire thatpart numbersbe sorted.IpreferINDEX/MATCH: Sheet1ColumnFcorrespondstothe Peanutsquestion. Takecarenotto rearrangetheSheet1 columns! The lookupformulawill grabdatafrom columnFno matterwhichquestionisassignedthere. I got aroundthisby settingaside asmall group of columns overto the right of the questionnairecolumns.TheseI devotedtokeyquestionslike peanutsandlatex.While itaddedabitto data entry,itallowedme tosort the questionnaire columnsfreely. Italsogave me a place to record data obtained fromsourcesbesidesthe questionnaire. Anotherworkaroundwouldbe to copythe INDEX/MATCHformulaintocell C1 – thatis, topull the columnheadingfrom Sheet1ColumnFby matching onthe phrase “Part Number”.
  • 6. Step 7: SimplifyMatters with a Macro As itstands,performingalookuprequiresfirstpastingthe Bill of Materials,thenselectingthe formularowsfrom somewhere andfinallypastingthemintothe appropriate spot.Thiscanall be done inone stepwitha VBA macro. First,decide where youwouldlike tostore the lookupformulas.Theyshouldbe inaplace that isaccessible tothe macro, and unlikelytobe deletedbythe user.Ikeptmine ona separate tab, buthere I’ll putthemintothe first row of the lookuptab.Aftermakingsure the macro worksproperly,I’dhide the row fromview. Hit Alt-F11to openthe VB editorinExcel,openanew module,andtype the followingcode: Sub PasteBoM() ‘ First make sure the ActiveCell is in the right column If ActiveCell.column <> 1 Then MsgBox(“Please select a cell in Column A and try again.” Exit Sub End If ‘ Then make sure the neighborhood 100 rows down and 4 columns right is clear If WorksheetFunction.CountA(Range(ActiveCell, _ ActiveCell.Offset(100,4))) > 0 Then Box = MsgBox(“You might be pasting new data on top of old data. _ Do you wish to continue?”, vbYesNo, “DANGER: Potential Loss of Data!”) Select Case box Case vbNo Exit Sub End Select End If ‘ Paste the BoM from the clipboard, then the formulas Selection.PasteSpecial (xlPasteAll) Range(“b1:e1”).Copy Selection.Offset(0,1) End Sub I assigned“Ctrl-j”tothe macro. It shouldbe notedthatmacros cannotbe reversed –that is,Ctrl-zdoesn’twork. That is whyI included the neighborhoodchecktoensure dataisnot unintentionallydeleted. Conclusion That’s it!Nowwe have an orderlyfilingsystem,apartslibrarythat pointstorelevantfiles,andameansto lookup meaningful datafromaBill of Materials. One final note.Inthe Lookupsection,INDEX/MATCHbroughtoverthe cell value –that is,the “Yes” or “No”. If I’d wantedtosee the file pathinstead,Iwouldhave tolookinside the HYPERLINKfunction. Say that the parts spreadsheethadthe followingentryincolumnEforpart numberGG1468: =HYPERLINK("SuppliersFabricCoForms CurrentGGparts signed.pdf","2") The file pathcan be obtainedwithtwoformulas: =FORMULATEXT(INDEX(Sheet1!E:E,MATCH($B2,Sheet1!$A:$A,0))) Returns =HYPERLINK("SuppliersFabricCoFormsCurrentGGpartssigned.pdf","2") So then =MID(F2,13,LEN(F2)-18) Returns SuppliersFabricCoFormsCurrentGGpartssigned.pdf Voila!