Hi
I create ranges manually contain some formulas
data in sheett
so when fill the userform
should search for empty range doesn't contain name in column B then result will be in first range like this
fill again form
result will be
fill again on form
result should insert new row before TOTAL row with the same formatting and formulas
if I select new name then use next range doesn't contain name in column B , if there is no more range is empty based on column B then should create range based on last range to fill by new name
thanks
I create ranges manually contain some formulas
data in sheett
tb.xlsm | ||||||||
---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | |||
1 | ITEM | NAME | INVOICE NO | DEBIT | CREDIT | BALANCE | ||
2 | 0.00 | |||||||
3 | 0.00 | |||||||
4 | TOTAL | 0.00 | 0.00 | 0.00 | ||||
5 | ||||||||
6 | ||||||||
7 | ||||||||
8 | ITEM | NAME | INVOICE NO | DEBIT | CREDIT | BALANCE | ||
9 | 0 | |||||||
10 | 0 | |||||||
11 | TOTAL | 0 | 0 | 0 | ||||
12 | ||||||||
13 | ||||||||
14 | ITEM | NAME | INVOICE NO | DEBIT | CREDIT | BALANCE | ||
15 | 0 | |||||||
16 | 0 | |||||||
17 | TOTAL | 0 | 0 | 0 | ||||
s |
Cell Formulas | ||
---|---|---|
Range | Formula | |
F2,F17,F15,F11,F9,F4 | F2 | =D2-E2 |
F3,F16,F10 | F3 | =F2+D3-E3 |
D17:E17,D11:E11,D4:E4 | D4 | =SUM(D2:D3) |
so when fill the userform
should search for empty range doesn't contain name in column B then result will be in first range like this
tb.xlsm | ||||||||
---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | |||
1 | ITEM | NAME | INVOICE NO | DEBIT | CREDIT | BALANCE | ||
2 | 1 | TUBER | A333 | 2,000.00 | 100.00 | 1,900.00 | ||
3 | 1,900.00 | |||||||
4 | TOTAL | 2,000.00 | 100.00 | 1,900.00 | ||||
5 | ||||||||
6 | ||||||||
7 | ||||||||
8 | ITEM | NAME | INVOICE NO | DEBIT | CREDIT | BALANCE | ||
9 | 0 | |||||||
10 | 0 | |||||||
11 | TOTAL | 0 | 0 | 0 | ||||
12 | ||||||||
13 | ||||||||
14 | ITEM | NAME | INVOICE NO | DEBIT | CREDIT | BALANCE | ||
15 | 0 | |||||||
16 | 0 | |||||||
17 | TOTAL | 0 | 0 | 0 | ||||
s |
Cell Formulas | ||
---|---|---|
Range | Formula | |
F2,F17,F15,F11,F9,F4 | F2 | =D2-E2 |
F3,F16,F10 | F3 | =F2+D3-E3 |
D17:E17,D11:E11,D4:E4 | D4 | =SUM(D2:D3) |
fill again form
result will be
tb.xlsm | ||||||||
---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | |||
1 | ITEM | NAME | INVOICE NO | DEBIT | CREDIT | BALANCE | ||
2 | 1 | TUBER | A333 | 2,000.00 | 100.00 | 1,900.00 | ||
3 | 2 | TUBER | A334 | 1,000.00 | 2,900.00 | |||
4 | TOTAL | 3,000.00 | 100.00 | 2,900.00 | ||||
5 | ||||||||
6 | ||||||||
7 | ||||||||
8 | ITEM | NAME | INVOICE NO | DEBIT | CREDIT | BALANCE | ||
9 | 0 | |||||||
10 | 0 | |||||||
11 | TOTAL | 0 | 0 | 0 | ||||
12 | ||||||||
13 | ||||||||
14 | ITEM | NAME | INVOICE NO | DEBIT | CREDIT | BALANCE | ||
15 | 0 | |||||||
16 | 0 | |||||||
17 | TOTAL | 0 | 0 | 0 | ||||
s |
Cell Formulas | ||
---|---|---|
Range | Formula | |
F2,F17,F15,F11,F9,F4 | F2 | =D2-E2 |
F3,F16,F10 | F3 | =F2+D3-E3 |
D17:E17,D11:E11,D4:E4 | D4 | =SUM(D2:D3) |
fill again on form
result should insert new row before TOTAL row with the same formatting and formulas
tb.xlsm | ||||||||
---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | |||
1 | ITEM | NAME | INVOICE NO | DEBIT | CREDIT | BALANCE | ||
2 | 1 | TUBER | A333 | 2,000.00 | 100.00 | 1,900.00 | ||
3 | 2 | TUBER | A334 | 1,000.00 | 2,900.00 | |||
4 | 3 | TUBER | A335 | 2,000.00 | 900.00 | |||
5 | TOTAL | 3,000.00 | 100.00 | 2,900.00 | ||||
6 | ||||||||
7 | ||||||||
8 | ITEM | NAME | INVOICE NO | DEBIT | CREDIT | BALANCE | ||
9 | 0 | |||||||
10 | 0 | |||||||
11 | TOTAL | 0 | 0 | 0 | ||||
12 | ||||||||
13 | ||||||||
14 | ITEM | NAME | INVOICE NO | DEBIT | CREDIT | BALANCE | ||
15 | 0 | |||||||
16 | 0 | |||||||
17 | TOTAL | 0 | 0 | 0 | ||||
s |
Cell Formulas | ||
---|---|---|
Range | Formula | |
F2,F17,F15,F11,F9,F5 | F2 | =D2-E2 |
F16,F10,F3:F4 | F3 | =F2+D3-E3 |
D5:E5 | D5 | =SUM(D2:D3) |
D17:E17,D11:E11 | D11 | =SUM(D9:D10) |
if I select new name then use next range doesn't contain name in column B , if there is no more range is empty based on column B then should create range based on last range to fill by new name
thanks