Dear Sir,
Dear VBA Exports,
I need your guidance to build a vba sript to loop through few data.
I can loop with in a range where all the row and column has data.
But when there are few column of the row doesnot have data i am not able to build a loop sript.
For example
I have a range from A6 to I14.
Range A6 to D14 has data only on Row 6, 10 & 14. and Range E6 to I14 has data in all cells.
I am looking for a loop to get result in the below format (Seperate line for each cell data"
Basically I am looking for it to loop from A6 to I14 then E7 to I7 then E8 to I8 then E9 to I9 then A10 to I10, E11 to I11 then E12 to I12 then E13 to I13 then A14 to I14.
Sample file attached for your reference.
Below is the result what i am looking to get through the loop.
Please help
Data Sheet
Expected looping result sheet.
Dear VBA Exports,
I need your guidance to build a vba sript to loop through few data.
I can loop with in a range where all the row and column has data.
But when there are few column of the row doesnot have data i am not able to build a loop sript.
For example
I have a range from A6 to I14.
Range A6 to D14 has data only on Row 6, 10 & 14. and Range E6 to I14 has data in all cells.
I am looking for a loop to get result in the below format (Seperate line for each cell data"
Basically I am looking for it to loop from A6 to I14 then E7 to I7 then E8 to I8 then E9 to I9 then A10 to I10, E11 to I11 then E12 to I12 then E13 to I13 then A14 to I14.
Sample file attached for your reference.
Below is the result what i am looking to get through the loop.
Please help
Data Sheet
Sample.xlsx | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | |||
5 | Voucher No* | Voucher Date (DD-MM-YYYY)* | Voucher Type* | Is Invoice* | Sales / Purchase Ledger Name* | Stock Item Name* | Qty* | Rate* | Stock Amount | ||
6 | Sales 001 | 01-04-2021 | Sales | Yes | Sale 28% | Mobile | 10 | 15,000 | 1,50,000 | ||
7 | Sale 28% | Mobile | 5 | 10,000 | 50,000 | ||||||
8 | Sale @ 18% | TV | 2 | 30,000 | 60,000 | ||||||
9 | Sale @ 18% | Battery | 2 | 6,000 | 12,000 | ||||||
10 | Sales 002 | 01-04-2021 | Sales | Yes | Sale 28% | Mobile | 5 | 15,000 | 75,000 | ||
11 | Sale 28% | Mobile | 3 | 10,000 | 30,000 | ||||||
12 | Sale @ 18% | TV | 1 | 30,000 | 30,000 | ||||||
13 | Sale @ 18% | Battery | 2 | 6,000 | 12,000 | ||||||
14 | Sales 003 | 01-04-2021 | Sales | Yes | Sale 28% | Mobile | 5 | 15,000 | 75,000 | ||
Data |
Cell Formulas | ||
---|---|---|
Range | Formula | |
I6:I14 | I6 | =G6*H6 |
Cells with Data Validation | ||
---|---|---|
Cell | Allow | Criteria |
C6 | List | Sales, Purchase |
D6 | List | Yes, No |
C10 | List | Sales, Purchase |
D10 | List | Yes, No |
C14 | List | Sales, Purchase |
D14 | List | Yes, No |
Expected looping result sheet.
Sample.xlsx | |||
---|---|---|---|
B | |||
1 | Sales 001 | ||
2 | 01-04-2021 | ||
3 | Sales | ||
4 | Yes | ||
5 | Sale 28% | ||
6 | Mobile | ||
7 | 10 | ||
8 | 15000 | ||
9 | 150000 | ||
10 | Sale 28% | ||
11 | Mobile | ||
12 | 5 | ||
13 | 10000 | ||
14 | 50000 | ||
15 | Sale @ 18% | ||
16 | TV | ||
17 | 2 | ||
18 | 30000 | ||
19 | 60000 | ||
20 | Sale @ 18% | ||
21 | Battery | ||
22 | 2 | ||
23 | 6000 | ||
24 | 12000 | ||
25 | Sales 002 | ||
26 | 01-04-2021 | ||
27 | Sales | ||
28 | Yes | ||
29 | Sale 28% | ||
30 | Mobile | ||
31 | 5 | ||
32 | 15000 | ||
33 | 75000 | ||
34 | Sale 28% | ||
35 | Mobile | ||
36 | 3 | ||
37 | 10000 | ||
38 | 30000 | ||
39 | Sale @ 18% | ||
40 | TV | ||
41 | 1 | ||
42 | 30000 | ||
43 | 30000 | ||
44 | Sale @ 18% | ||
45 | Battery | ||
46 | 2 | ||
47 | 6000 | ||
48 | 12000 | ||
49 | Sales 003 | ||
50 | 01-04-2021 | ||
51 | Sales | ||
52 | Yes | ||
53 | Sale 28% | ||
54 | Mobile | ||
55 | 5 | ||
56 | 15000 | ||
57 | 75000 | ||
Expected Result |
Cell Formulas | ||
---|---|---|
Range | Formula | |
B1 | B1 | =Data!A6 |
B2 | B2 | =Data!B6 |
B3 | B3 | =Data!C6 |
B4 | B4 | =Data!D6 |
B5 | B5 | =Data!E6 |
B6 | B6 | =Data!F6 |
B7 | B7 | =Data!G6 |
B8 | B8 | =Data!H6 |
B9 | B9 | =Data!I6 |
B10 | B10 | =Data!E7 |
B11 | B11 | =Data!F7 |
B12 | B12 | =Data!G7 |
B13 | B13 | =Data!H7 |
B14 | B14 | =Data!I7 |
B15 | B15 | =Data!E8 |
B16 | B16 | =Data!F8 |
B17 | B17 | =Data!G8 |
B18 | B18 | =Data!H8 |
B19 | B19 | =Data!I8 |
B20 | B20 | =Data!E9 |
B21 | B21 | =Data!F9 |
B22 | B22 | =Data!G9 |
B23 | B23 | =Data!H9 |
B24 | B24 | =Data!I9 |
B25 | B25 | =Data!A10 |
B26 | B26 | =Data!B10 |
B27 | B27 | =Data!C10 |
B28 | B28 | =Data!D10 |
B29 | B29 | =Data!E10 |
B30 | B30 | =Data!F10 |
B31 | B31 | =Data!G10 |
B32 | B32 | =Data!H10 |
B33 | B33 | =Data!I10 |
B34 | B34 | =Data!E11 |
B35 | B35 | =Data!F11 |
B36 | B36 | =Data!G11 |
B37 | B37 | =Data!H11 |
B38 | B38 | =Data!I11 |
B39 | B39 | =Data!E12 |
B40 | B40 | =Data!F12 |
B41 | B41 | =Data!G12 |
B42 | B42 | =Data!H12 |
B43 | B43 | =Data!I12 |
B44 | B44 | =Data!E13 |
B45 | B45 | =Data!F13 |
B46 | B46 | =Data!G13 |
B47 | B47 | =Data!H13 |
B48 | B48 | =Data!I13 |
B49 | B49 | =Data!A14 |
B50 | B50 | =Data!B14 |
B51 | B51 | =Data!C14 |
B52 | B52 | =Data!D14 |
B53 | B53 | =Data!E14 |
B54 | B54 | =Data!F14 |
B55 | B55 | =Data!G14 |
B56 | B56 | =Data!H14 |
B57 | B57 | =Data!I14 |