Match combobox name on userform with shee name and fill empty cell

Maklil

Board Regular
Joined
Jun 23, 2022
Messages
174
Office Version
  1. 2019
Platform
  1. Windows
Hello
I want matching combobox1 name with sheet name , if matched the name then should search for empty cell in column D and if I select optionbutton1(PAID) or optionbutton1(NOT PAID) then will auto fill except the last row where contains TOTAL word in column A
here is example
data in sheets
Maklil.xlsx
ABCDEFG
1DATEINV NNOIDCASEQTYUNIT PRICEBALANCE
221/08/2023VT NO 1000FOO LL 1000220.00123.0027,060.00
321/08/2023VT NO 1000GNOO HH 1200100.00122.0012,200.00
421/08/2023VT NO 1000AS100-12120.00111.0013,320.00
5TOTAL52,580.00
621/08/2023VT NO 1001MGFH GA-100NOT PAID100.00110.0011,000.00
721/08/2023VT NO 1001MGFH GA-101NOT PAID120.00111.0013,320.00
821/08/2023VT NO 1001MGFH GA-102NOT PAID110.00110.0012,100.00
921/08/2023VT NO 1001MGFH GA-103NOT PAID12.00100.001,200.00
10TOTAL37,620.00
1121/08/2023VT NO 1002SSFOO 1000 MN1NOT PAID20.00124.002,480.00
1221/08/2023VT NO 1002SSFOO 1000 MN2NOT PAID30.00122.003,660.00
1321/08/2023VT NO 1002SSFOO 1000 MN3NOT PAID24.00124.002,976.00
1421/08/2023VT NO 1002SSFOO 1000 MN4NOT PAID22.00125.002,750.00
1521/08/2023VT NO 1002SSFOO 1000 MN5NOT PAID10.00144.001,440.00
16TOTAL13,306.00
1721/08/2023VT NO 1003OOIL AS-10010.00145.001,450.00
1821/08/2023VT NO 1003OOIL AS-10125.00150.003,750.00
1921/08/2023VT NO 1003OOIL AS-10240.00155.006,200.00
2021/08/2023VT NO 1003OOIL AS-10355.00160.008,800.00
2121/08/2023VT NO 1003OOIL AS-10470.00165.0011,550.00
2221/08/2023VT NO 1003OOIL AS-10585.00170.0014,450.00
2321/08/2023VT NO 1003OOIL AS-106100.00175.0017,500.00
2421/08/2023VT NO 1003OOIL AS-107115.00180.0020,700.00
25TOTAL84,400.00
2622/08/2023VT NO 1004OOIL AS-108PAID130.00185.0024,050.00
2722/08/2023VT NO 1004OOIL AS-109PAID145.00190.0027,550.00
2822/08/2023VT NO 1004OOIL AS-110PAID160.00195.0031,200.00
2922/08/2023VT NO 1004OOIL AS-111PAID175.00200.0035,000.00
3022/08/2023VT NO 1004OOIL AS-112PAID190.00205.0038,950.00
3122/08/2023VT NO 1004OOIL AS-113PAID205.00210.0043,050.00
3222/08/2023VT NO 1004OOIL AS-114PAID220.00215.0047,300.00
33TOTAL247,100.00
BUYING
Cell Formulas
RangeFormula
G26:G32,G17:G24,G6:G9,G2:G4G2=E2*F2
G5G5=SUM(G2:G4)
G10G10=SUM(G6:G9)
G11:G15G11=F11*E11
G16G16=SUM(G11:G15)
G25G25=SUM(G17:G24)
G33G33=SUM(G26:G32)


Maklil.xlsx
ABCDEFG
1DATEINV NNOIDCASEQTYUNIT PRICEBALANCE
221/08/2023ST NO 1000GNOO HH 1200PAID10.00150.001,500.00
321/08/2023ST NO 1000AS100-12PAID10.00130.001,300.00
4TOTAL2,800.00
521/08/2023ST NO 1001MGFH GA-103NOT PAID15.00130.001,950.00
6TOTAL1,950.00
721/08/2023ST NO 1002SSFOO 1000 MN1NOT PAID2.00140.00280.00
821/08/2023ST NO 1002SSFOO 1000 MN2NOT PAID12.00145.001,740.00
921/08/2023ST NO 1002SSFOO 1000 MN3NOT PAID10.00145.001,450.00
10TOTAL3,470.00
1124/08/2023VT NO 1003OOIL AS-10010.00145.001,450.00
1224/08/2023VT NO 1003OOIL AS-10125.00150.003,750.00
1324/08/2023VT NO 1003OOIL AS-10240.00155.006,200.00
1424/08/2023VT NO 1003OOIL AS-10355.00160.008,800.00
1524/08/2023VT NO 1003OOIL AS-10470.00165.0011,550.00
1624/08/2023VT NO 1003OOIL AS-10585.00170.0014,450.00
1724/08/2023VT NO 1003OOIL AS-106100.00175.0017,500.00
1824/08/2023VT NO 1003OOIL AS-107115.00180.0020,700.00
19TOTAL84,400.00
SELLING
Cell Formulas
RangeFormula
G11:G18,G5,G2:G3G2=E2*F2
G4G4=SUM(G2:G3)
G6G6=SUM(G5:G5)
G7:G9G7=F7*E7
G10G10=SUM(G7:G9)
G19G19=SUM(G11:G18)




when select sheet (BUYING) from combobox1 and optionbutton1 (PAID)

A1.PNG




RESULT
Maklil.xlsx
ABCDEFGH
1DATEINV NNOIDCASEQTYUNIT PRICEBALANCE
221/08/2023VT NO 1000FOO LL 1000PAID220.00123.0027,060.00
321/08/2023VT NO 1000GNOO HH 1200PAID100.00122.0012,200.00
421/08/2023VT NO 1000AS100-12PAID120.00111.0013,320.00
5TOTAL52,580.00
621/08/2023VT NO 1001MGFH GA-100NOT PAID100.00110.0011,000.00BUYING
721/08/2023VT NO 1001MGFH GA-101NOT PAID120.00111.0013,320.00SELLING
821/08/2023VT NO 1001MGFH GA-102NOT PAID110.00110.0012,100.00
921/08/2023VT NO 1001MGFH GA-103NOT PAID12.00100.001,200.00
10TOTAL37,620.00
1121/08/2023VT NO 1002SSFOO 1000 MN1NOT PAID20.00124.002,480.00
1221/08/2023VT NO 1002SSFOO 1000 MN2NOT PAID30.00122.003,660.00
1321/08/2023VT NO 1002SSFOO 1000 MN3NOT PAID24.00124.002,976.00
1421/08/2023VT NO 1002SSFOO 1000 MN4NOT PAID22.00125.002,750.00
1521/08/2023VT NO 1002SSFOO 1000 MN5NOT PAID10.00144.001,440.00
16TOTAL13,306.00
1721/08/2023VT NO 1003OOIL AS-100PAID10.00145.001,450.00
1821/08/2023VT NO 1003OOIL AS-101PAID25.00150.003,750.00
1921/08/2023VT NO 1003OOIL AS-102PAID40.00155.006,200.00
2021/08/2023VT NO 1003OOIL AS-103PAID55.00160.008,800.00
2121/08/2023VT NO 1003OOIL AS-104PAID70.00165.0011,550.00
2221/08/2023VT NO 1003OOIL AS-105PAID85.00170.0014,450.00
2321/08/2023VT NO 1003OOIL AS-106PAID100.00175.0017,500.00
2421/08/2023VT NO 1003OOIL AS-107PAID115.00180.0020,700.00
25TOTAL84,400.00
2622/08/2023VT NO 1004OOIL AS-108PAID130.00185.0024,050.00
2722/08/2023VT NO 1004OOIL AS-109PAID145.00190.0027,550.00
2822/08/2023VT NO 1004OOIL AS-110PAID160.00195.0031,200.00
2922/08/2023VT NO 1004OOIL AS-111PAID175.00200.0035,000.00
3022/08/2023VT NO 1004OOIL AS-112PAID190.00205.0038,950.00
3122/08/2023VT NO 1004OOIL AS-113PAID205.00210.0043,050.00
3222/08/2023VT NO 1004OOIL AS-114PAID220.00215.0047,300.00
33TOTAL247,100.00
BUYING
Cell Formulas
RangeFormula
G26:G32,G17:G24,G6:G9,G2:G4G2=E2*F2
G5G5=SUM(G2:G4)
G10G10=SUM(G6:G9)
G11:G15G11=F11*E11
G16G16=SUM(G11:G15)
G25G25=SUM(G17:G24)
G33G33=SUM(G26:G32)



when select sheet (SELLING) from combobox1 and optionbutton1 (NOT PAID)
A2.PNG


result
Maklil.xlsx
ABCDEFG
1DATEINV NNOIDCASEQTYUNIT PRICEBALANCE
221/08/2023ST NO 1000GNOO HH 1200PAID10.00150.001,500.00
321/08/2023ST NO 1000AS100-12PAID10.00130.001,300.00
4TOTAL2,800.00
521/08/2023ST NO 1001MGFH GA-103NOT PAID15.00130.001,950.00
6TOTAL1,950.00
721/08/2023ST NO 1002SSFOO 1000 MN1NOT PAID2.00140.00280.00
821/08/2023ST NO 1002SSFOO 1000 MN2NOT PAID12.00145.001,740.00
921/08/2023ST NO 1002SSFOO 1000 MN3NOT PAID10.00145.001,450.00
10TOTAL3,470.00
1124/08/2023VT NO 1003OOIL AS-100NOT PAID10.00145.001,450.00
1224/08/2023VT NO 1003OOIL AS-101NOT PAID25.00150.003,750.00
1324/08/2023VT NO 1003OOIL AS-102NOT PAID40.00155.006,200.00
1424/08/2023VT NO 1003OOIL AS-103NOT PAID55.00160.008,800.00
1524/08/2023VT NO 1003OOIL AS-104NOT PAID70.00165.0011,550.00
1624/08/2023VT NO 1003OOIL AS-105NOT PAID85.00170.0014,450.00
1724/08/2023VT NO 1003OOIL AS-106NOT PAID100.00175.0017,500.00
1824/08/2023VT NO 1003OOIL AS-107NOT PAID115.00180.0020,700.00
19TOTAL84,400.00
SELLING
Cell Formulas
RangeFormula
G11:G18,G5,G2:G3G2=E2*F2
G4G4=SUM(G2:G3)
G6G6=SUM(G5:G5)
G7:G9G7=F7*E7
G10G10=SUM(G7:G9)
G19G19=SUM(G11:G18)
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,223,885
Messages
6,175,178
Members
452,615
Latest member
bogeys2birdies

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