Lantern
New Member
- Joined
- May 9, 2024
- Messages
- 10
- Office Version
- 365
- Platform
- Windows
I have an Excel parts list in which the part section headers are to be hidden if no parts are selected within the section.
I need to loop through a column range that contains a formula-generated index to create a filter in the adjacent column. The part qty may be in one of many columns, so I created the Index to mark the part rows. Section rows that contain a part qty (as described below) are to be marked with a Y.
I've been testing my loops on a sample file that only shows an Index Column with no part information shown.
A section row starts where an Index Row = 1 and extends to where the next Index Row = 1.
Index Values:
0 = Blank Row (Desired Y/N result = N)
1 = Section Row (Desired Y/N result = Y if any parts in the section have a Qty > 0)
2 = Part Row with Qty = 0 (Desired Y/N result = N)
3 = Part Row with Qty > 0 (Desired Y/N result = Y)
The Index Col always starts at C4 and extends to the last row. There will be nothing in the file past the last parts row.
The Index Column can be a few to hundreds of rows long with zero to many variable length sections.
Suggestions, please.
Thanks.
Sample file below . . .
I need to loop through a column range that contains a formula-generated index to create a filter in the adjacent column. The part qty may be in one of many columns, so I created the Index to mark the part rows. Section rows that contain a part qty (as described below) are to be marked with a Y.
I've been testing my loops on a sample file that only shows an Index Column with no part information shown.
A section row starts where an Index Row = 1 and extends to where the next Index Row = 1.
Index Values:
0 = Blank Row (Desired Y/N result = N)
1 = Section Row (Desired Y/N result = Y if any parts in the section have a Qty > 0)
2 = Part Row with Qty = 0 (Desired Y/N result = N)
3 = Part Row with Qty > 0 (Desired Y/N result = Y)
The Index Col always starts at C4 and extends to the last row. There will be nothing in the file past the last parts row.
The Index Column can be a few to hundreds of rows long with zero to many variable length sections.
Suggestions, please.
Thanks.
Sample file below . . .
COUNT TEST 8.xlsm | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
B | C | D | E | F | G | H | I | |||
2 | ||||||||||
3 | Formula Generated Index | Desired Y/N VBA Results | Parts Row Index Key | Parts Row Description | ||||||
4 | 1 | Y | 0 | Blank | ||||||
5 | 3 | Y | 1 | Section Header | ||||||
6 | 2 | N | 2 | Blank Part | ||||||
7 | 2 | N | 3 | Part w/Qty | ||||||
8 | 2 | N | ||||||||
9 | 3 | Y | ||||||||
10 | 3 | Y | ||||||||
11 | 2 | N | ||||||||
12 | 2 | N | ||||||||
13 | 3 | Y | ||||||||
14 | 2 | N | ||||||||
15 | 0 | N | ||||||||
16 | 1 | N | ||||||||
17 | 2 | N | ||||||||
18 | 2 | N | ||||||||
19 | 2 | N | ||||||||
20 | 2 | N | ||||||||
21 | 0 | N | ||||||||
22 | 2 | N | ||||||||
23 | 2 | N | ||||||||
24 | 2 | N | ||||||||
25 | 0 | N | ||||||||
26 | 2 | N | ||||||||
27 | 1 | Y | ||||||||
28 | 0 | N | ||||||||
29 | 3 | Y | ||||||||
30 | 3 | Y | ||||||||
31 | 3 | Y | ||||||||
32 | 3 | Y | ||||||||
33 | 2 | Y | ||||||||
34 | 0 | N | ||||||||
35 | 1 | N | ||||||||
36 | 2 | N | ||||||||
37 | 2 | N | ||||||||
38 | 2 | N | ||||||||
39 | 2 | N | ||||||||
40 | 0 | N | ||||||||
41 | 0 | N | ||||||||
42 | 0 | N | ||||||||
43 | ||||||||||
Sheet1 |