VBA to Populate an Issue Status Cell

Desiato34

New Member
Joined
May 17, 2023
Messages
1
Office Version
  1. 2016
Platform
  1. Windows
Hi,

Nice to join the forum, I am reasonably experienced in Excel but a complete beginner in VBA. I have just done a couple of basic training courses but still feel a little overwhelmed when trying
to start a new project.

I have a deliverables list that we use to track our drawing issues. It contains a variable number of rows and columns, with some columns prepopulated for the Planned issue dates, we then fill
in the dates when the deliverables are actually issued.
I have set the spreadsheet to use a HLOOKUP and a hidden table sheet to automatically populate the current Issue status of each deliverable in column C.

Look Up Sheet
1684320921041.png



In order to ignore the two Planned Date columns I have had to split the formulas (columns E & F) and then add a third (column D) to consolidate that information.
1684320800649.png


The formulas in columns D, E & F are these respectively, each one finds the last populated cell and gets the header name for that column.
Column D, E & F are normally hidden columns that contain these formula;
Col D: =LOOKUP(2,1/(E3:F3<>""),E3:F3)
Col E: =IF(COUNTA(I3:J3)=0,"",INDEX($I$1:$J$1,MATCH(LOOKUP(2,1/(I3:J3<>""),I3:J3),I3:J3,0)))
Col F: =IF(COUNTA(L3:AD3)=0,"",INDEX($L$1:$AD$1,MATCH(LOOKUP(2,1/(L3:AD3<>""),L3:AD3),L3:AD3,0)))

This works but does not strike me as a very elegant way of doing the job.
I would like to do this with VBA but honestly do not know where to start.

I have attached a copy of the sheet, if anybody could be so kind as to give me some pointers of where to start and how to go about this I would be most grateful.

Thank you very much.

Mick

Drawing Issue Register v3.xlsx
BCDEFGHIJKLMNOPQRSTU
1TITLEISSUEDLAST ISSUED STATUSBEFORE PLANNED AFCAFTER PLANNED AFCPlanned IFR (00) DateIssued IFR (00)CPY comment (00)Planned AFC (01) DateIssued AFC (01)CPY comment (01)Reissued AFC (02)CPY comment (02)Reissued AFC (03)CPY comment (03)Reissued AFC (04)CPY comment (04)Reissued AFC (05)CPY comment (05)
2
3CPF - POWERGEN WBS-4100 - GTG FOUNDATIONS - KEY PLAN02Reissued AFC (02)Issued IFR (00)Reissued AFC (02)25/05/202211-May-2201/12/202212-Dec-2207-Feb-23
4CPF - POWERGEN WBS-4100 - GTG FOUNDATION GENERAL ARRANGEMENT - PLAN 01Issued AFC (01)Issued IFR (00)Issued AFC (01)25/05/202211-May-2201/12/202212-Dec-22
5CPF - POWERGEN WBS-4100 - GTG FOUNDATION GENERAL ARRANGEMENT - LONGITUDINAL & TRANSVERSE SECTIONS 02Reissued AFC (02)Issued IFR (00)Reissued AFC (02)25/05/202211-May-2201/12/202212-Dec-2202-Feb-23
6CPF - POWERGEN WBS-4100 - GTG FOUNDATION RC DETAILS - TOP REINFORCEMENT01Issued AFC (01)Issued IFR (00)Issued AFC (01)25/05/202219-May-2201/12/202219-Dec-22
7CPF - POWERGEN WBS-4100 - GTG FOUNDATION RC DETAILS - MIDDLE REINFORCEMENT01Issued AFC (01)Issued IFR (00)Issued AFC (01)25/05/202219-May-2201/12/202219-Dec-22
8CPF - POWERGEN WBS-4100 - GTG FOUNDATION RC DETAILS - BOTTOM REINFORCEMENT02Reissued AFC (02)Issued IFR (00)Reissued AFC (02)25/05/202219-May-2201/12/202219-Dec-2203-Feb-23
9CPF - POWERGEN WBS-4100 - GTG FOUNDATION RC DETAILS - PLINTH REINFORCEMENT - SHEET 101Issued AFC (01)Issued IFR (00)Issued AFC (01)25/05/202219-Dec-2201/12/202203-Feb-23
10CPF - POWERGEN WBS-4100 - GTG FOUNDATION RC DETAILS - PLINTH REINFORCEMENT - SHEET 201Issued AFC (01)Issued IFR (00)Issued AFC (01)25/05/202219-Dec-2201/12/202203-Feb-23
11CPF - POWERGEN WBS-4100 - GTG FOUNDATION RC DETAILS - POCKET REINFORCEMENT01Issued AFC (01)Issued IFR (00)Issued AFC (01)25/05/202219-Dec-2201/12/202203-Feb-23
12CPF - POWERGEN WBS-4100 - GTG FOUNDATION - DUCTS - PLAN01Issued AFC (01)Issued IFR (00)Issued AFC (01)25/05/202212-Dec-2201/12/202207-Feb-23
13CPF - POWERGEN WBS-4100 - GTG FOUNDATION ELECTRICAL - DUCTS - ELEVATIONS01Issued AFC (01)Issued IFR (00)Issued AFC (01)25/05/202212-Dec-2201/12/202207-Feb-23
14CPF - POWERGEN WBS-4100 - EXHAUST STACK FOUNDATION - PLANS, SECTIONS AND RC DETAILS - SHEET 102Reissued AFC (02)Issued IFR (00)Reissued AFC (02)25/05/202219-Aug-2201/12/202206-Dec-2206-Apr-23
15CPF - POWERGEN WBS-4100 - EXHAUST STACK FOUNDATION - PEDESTAL PLANS, SECTIONS AND RC DETAILS - SHEET 201Issued AFC (01)Issued IFR (00)Issued AFC (01)25/05/202219-Aug-2201/12/202206-Apr-23
16CPF - POWERGEN WBS-4100 - INLET FILTER HOUSE FOUNDATION - PLANS, SECTIONS AND RC DETAILS - SHEET 102Reissued AFC (02)Issued IFR (00)Reissued AFC (02)25/05/202219-Aug-2201/12/202206-Dec-2212-Jan-23
17CPF - POWERGEN WBS-4100 - INLET FILTER HOUSE FOUNDATION - PEDESTAL PLANS, SECTIONS AND RC DETAILS - SHEET 202Reissued AFC (02)Issued IFR (00)Reissued AFC (02)25/05/202219-Aug-2201/12/202206-Dec-2212-Jan-23
18CPF - POWERGEN WBS-4100 - LUBE OIL COOLER FOUNDATION - PLANS, SECTIONS AND RC DETAILS03Reissued AFC (03)Issued IFR (00)Reissued AFC (03)25/05/202226-Aug-2201/12/202213-Jan-2306-Feb-2314-Apr-23
19CPF - POWERGEN WBS-4100 - ATOMIZING AIR COOLER FOUNDATION - PLANS, SECTIONS AND RC DETAILS03Reissued AFC (03)Issued IFR (00)Reissued AFC (03)25/05/202226-Aug-2201/12/202213-Jan-2306-Feb-2314-Apr-23
20CPF - POWERGEN WBS-4100 - GTG TRANSFORMER FOUNDATION - PLAN, SECTIONS AND RC DETAILS00Issued IFR (00)Issued IFR (00) 25/05/202210-Mar-2301/12/2022
21CPF - POWERGEN WBS-4100 - GTG TRANSFORMER WALL - PLAN, SECTIONS AND RC DETAILS00Issued IFR (00)Issued IFR (00) 25/05/202210-Mar-2301/12/2022
22CPF - POWERGEN WBS-4100 - FUEL GAS SCRUBBER SKID FOUNDATION02Reissued AFC (02)Issued IFR (00)Reissued AFC (02)25/05/202213-Jan-2301/12/202207-Feb-2328-Mar-23
23CPF - POWERGEN WBS-4100 - FIRE EXTINQUISHING BOTTLE SKID FOUNDATION01Issued AFC (01)Issued IFR (00)Issued AFC (01)25/05/202213-Jan-2301/12/202207-Feb-23
24CPF - POWERGEN WBS-4100 - HOT GAS PATH WASHING SKID FOUNDATION01Issued AFC (01)Issued IFR (00)Issued AFC (01)25/05/202213-Jan-2301/12/202207-Feb-23
25CPF -POWERGEN AREA CABLERACK 4100-EIT-001 AND 002 FOUNDATION PLANS - LOCATION PLAN - SHEET 100Issued IFR (00)Issued IFR (00) 25/05/202222-Feb-2301/12/2022
26CPF - POWERGEN AREA CABLERACK 4100-EIT-001 AND 002 FOUNDATION PLANS - SECTION AND RC DETAILS - SHEET 200Issued IFR (00)Issued IFR (00) 25/05/202222-Feb-2301/12/2022
27CPF - POWERGEN AREA CABLERACK 4100-EIT-001 AND 002 PEDESTAL PLANS - SECTION AND RC DETAILS - SHEET 300Issued IFR (00)Issued IFR (00) 25/05/202222-Feb-2301/12/2022
28VOID - CPF - EIT BUILDING SUBSTATION NORTH FOUNDATION - RC DETAILS - SHEET 5NOT ISSUED#N/A  25/05/202201/12/2022
29VOID - CPF - EIT BUILDING SUBSTATION NORTH FOUNDATION - RC DETAILS - SHEET 6NOT ISSUED#N/A  25/05/202201/12/2022
30CPF - POWERGEN AREA PIPERACK 4100-PPR-001 TO 006 - FOUNDATION LOCATION PLAN - SHEET 101Issued AFC (01)Issued IFR (00)Issued AFC (01)25/05/202201-Jul-2201/12/202206-Feb-23
31CPF - POWERGEN AREA PIPERACK 4100-PPR-001 TO 006 - FOUNDATION PLANS, SECTIONS AND RC DETAILS - SHEET 201Issued AFC (01)Issued IFR (00)Issued AFC (01)25/05/202201-Jul-2201/12/202206-Feb-23
32CPF - POWERGEN AREA PIPERACK 4100-PPR-001 TO 006 - FOUNDATION PLANS, SECTIONS AND RC DETAILS - SHEET 301Issued AFC (01)Issued IFR (00)Issued AFC (01)25/05/202201-Jul-2201/12/202206-Feb-23
33CPF - POWERGEN AREA PIPERACK 4100-PPR-001 TO 006 - PEDESTAL PLANS, SECTIONS AND RC DETAILS - SHEET 401Issued AFC (01)Issued IFR (00)Issued AFC (01)25/05/202201-Jul-2201/12/202206-Feb-23
34CPF - POWERGEN AREA PIPERACK - 4100-FPR-001 TO 004 AND 4100-FPR-001a TO 004a - FOUNDATION LOCATION PLAN - SHEET 101Issued AFC (01)Issued IFR (00)Issued AFC (01)25/05/202201-Jul-2201/12/202223-Mar-23
35CPF - POWERGEN AREA PIPERACK - 4100-FPR-001 TO 004 AND 4100-FPR-001a TO 004a - FOUNDATION PLANS, SECTIONS AND RC DETAILS - SHEET 201Issued AFC (01)Issued IFR (00)Issued AFC (01)25/05/202201-Jul-2201/12/202223-Mar-23
36CPF - POWERGEN AREA PIPERACK - 4100-FPR-001 TO 004 AND 4100-FPR-001a TO 004a - PEDESTAL PLANS, SECTIONS AND RC DETAILS - SHEET 301Issued AFC (01)Issued IFR (00)Issued AFC (01)25/05/202201-Jul-2201/12/202223-Mar-23
37CPF - POWERGEN WBS-4100 - ELECTRICAL TRENCHES - PLAN - SHEET 1NOT ISSUED#N/A  
38CPF - POWERGEN WBS-4100 - ELECTRICAL TRENCHES - ELEVATIONS AND DETAILS - SHEET 2NOT ISSUED#N/A  
39CPF - POWERGEN WBS-4100 - ELECTRICAL TRENCHES - DETAILS SHEET 3NOT ISSUED#N/A  
40#N/A  
41#N/A  
Civils-Fdns
Cell Formulas
RangeFormula
D3:D41D3=LOOKUP(2,1/(E3:F3<>""),E3:F3)
E3:E41E3=IF(COUNTA(I3:J3)=0,"",INDEX($I$1:$J$1,MATCH(LOOKUP(2,1/(I3:J3<>""),I3:J3),I3:J3,0)))
F3:F41F3=IF(COUNTA(L3:AD3)=0,"",INDEX($L$1:$AD$1,MATCH(LOOKUP(2,1/(L3:AD3<>""),L3:AD3),L3:AD3,0)))
C3:C39C3=IFERROR(HLOOKUP(D3,LOOKUPDATA!$A$4:$O$5,2,FALSE), "NOT ISSUED")




Drawing Issue Register v3.xlsx
ABCDEFGHIJKLMNO
1LOOKUP TABLE - DO NOT DELETE
2
3
4Not IssuedPlanned IFR (00) DateIssued IFR (00)CPY comment (00)Planned AFC (01) DateIssued AFC (01)CPY comment (01)Reissued AFC (02)CPY comment (02)Reissued AFC (03)CPY comment (03)Reissued AFC (04)CPY comment (04)Reissued AFC (05)CPY comment (05)
5Not Issued00000001010202030304040505
LOOKUPDATA
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Forum statistics

Threads
1,224,819
Messages
6,181,153
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top