+ Reply to Thread
Results 1 to 9 of 9

multiple optionbuttons on userform to merge multiple sheets and calculate stock

  1. #1
    Forum Contributor
    Join Date
    07-14-2021
    Location
    LY
    MS-Off Ver
    2019
    Posts
    271

    multiple optionbuttons on userform to merge multiple sheets and calculate stock

    Hi guys
    here my project is extemely complicated to calculate the stock across sheets by using userform
    what I want :
    1- when run the userform should be optionbutton(stock) default
    and calculation the stock ( before calculation if there is duplicate item for each sheet alone should be merge for each duplicate item for each sheet alone based on column D except sheet FFR doesn't contains duplicate items at all ) and the formula based on sheets names for columns H,J should be( PURCHASE-SELLING +RETURNSS-RETURPP+FFR) based on column ID-CC
    based on optionbutton (STOCK) take IDTR-100 as example

    when merge in sheet PURCHASE= column (QTY)=90 & column (TOTAL) =10,200 as to sheet SELLING = column (QTY)=15 & column (TOTAL) =1,770 as to sheet RETURNSS column (QTY)=2 & column (TOTAL) =220 as to sheet RETURNPP column (QTY)=5 & column (TOTAL) =600 as to sheet FFR column (QTY)=200 & column (TOTAL) =24000
    now the final result QTY=90-15+2-5+200=272(as show in listbox based on selected STOCK)
    TOTAL=10,200-1,770+220-600+24,000=32,050(as show in listbox based on selected STOCK )
    with considering there is minus values becuase there are some items are existed in some sheets but not all when implement the formula for calculation will give you minus
    as to optionbutton PURCHASE


    it includes three sheets when calculation (PURCHASE -RETURNPP+FFR)
    take IDTR-102 as example
    when merge in sheet PURCHASE= column (QTY)=5 & column (TOTAL) =500 as to sheet RETURNPP column (QTY)=4 & column (TOTAL) =400 as to sheet FFR column (QTY)=20 & column (TOTAL) =2000
    the final result QTY=5-4+20=21(as show in listbox based on selected PURCHASE)
    TOTAL=500-400+2000=2100 (as show in listbox based on selected PURCHASE)
    as to optionbutton (SALES)

    it includes two sheets when calculation (SELLING-RETURNSS)
    take IDTR-110 as example
    when merge in sheet SELLING = column (QTY)=0 & column (TOTAL) =0(there is not existed this item) as to sheet RETURNSS column (QTY)=10 & column (TOTAL) =3000
    the final result QTY=0-10=-10(as show in listbox based on selected SALES)
    TOTAL=0-3000=-3000 (as show in listbox based on selected SALES )
    last thin should also after select one of them optionbutton when write the item based on column contain header ID-CC into textbox1 should filter in list box based on written into textbox1. and ignore columns CLIENT NO , INVOICE NO & PRICE when populate data in listbox .
    note : each picture I did manually to understand my idea

    if anybody interest to help me please inform me if need more details
    thanks
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by Mussa-A; 06-13-2022 at 12:27 PM.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,178

    Re: multiple optionbuttons on userform to merge multiple sheets and calculate stock

    Please Login or Register  to view this content.

    in main module1

    Please Login or Register  to view this content.
    Attached Files Attached Files
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Forum Contributor
    Join Date
    07-14-2021
    Location
    LY
    MS-Off Ver
    2019
    Posts
    271

    Re: multiple optionbuttons on userform to merge multiple sheets and calculate stock

    thanks . just question ? did you tested your code ,tested your attaching?
    I no know where is my mistake. from the glance of your code yoy seem forgot procedure of listbox . I don't find it inside the code.
    it doesn't show any thing in listbox when select any optionbutton. I hope to see this problem when you have free time .

  4. #4
    Forum Contributor
    Join Date
    07-14-2021
    Location
    LY
    MS-Off Ver
    2019
    Posts
    271

    Re: multiple optionbuttons on userform to merge multiple sheets and calculate stock

    Hi John
    did you see my replying ?

  5. #5
    Forum Contributor
    Join Date
    07-14-2021
    Location
    LY
    MS-Off Ver
    2019
    Posts
    271

    Re: multiple optionbuttons on userform to merge multiple sheets and calculate stock

    another option guys ?

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,178

    Re: multiple optionbuttons on userform to merge multiple sheets and calculate stock

    I only focused on the "calculation" function as it wasn't clear to me what you wanted in the listbox for each selection.

    Explain so others may/can help.

  7. #7
    Forum Contributor
    Join Date
    07-14-2021
    Location
    LY
    MS-Off Ver
    2019
    Posts
    271

    Re: multiple optionbuttons on userform to merge multiple sheets and calculate stock

    Hi John
    I attached some picture to see what I want because all of details are not enough that's why posted the pictures . the idea based on function to calculate for each specific sheets based on selected optionbuttons . the orginal code when run the useform show the data based on one sheet and search the item within the showd into listbox . now based on calculation of function when select one of the optionbuttons should show the data changes into listbox by calculation when select any optionbutton . how can I call your function and show into listbox when select one of the optionbutton to see the calculation in listbox,please?

  8. #8
    Forum Contributor
    Join Date
    07-14-2021
    Location
    LY
    MS-Off Ver
    2019
    Posts
    271

    Re: multiple optionbuttons on userform to merge multiple sheets and calculate stock

    too strange !!!
    I'm still waiting for experts to solve my questions.

  9. #9
    Forum Contributor
    Join Date
    07-14-2021
    Location
    LY
    MS-Off Ver
    2019
    Posts
    271

    Re: multiple optionbuttons on userform to merge multiple sheets and calculate stock

    it seems to impossile to solve it .
    posted here https://www.mrexcel.com/board/thread...stock.1208687/

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] populate values into textbox on userform based on multiple combobox and two optionbuttons
    By ABDELFATTA in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-15-2020, 12:52 AM
  2. [SOLVED] filter data in in listbox by multiple optionbuttons for multiple sheets
    By abdo meghari in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-05-2020, 04:48 AM
  3. [SOLVED] Merge multiple sheets data into one worksheet based on multiple criteria and date
    By hecgroups in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 02-03-2018, 04:19 AM
  4. Userform Fame with multiple optionbuttons
    By eldaye in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-01-2016, 06:10 PM
  5. [SOLVED] Merge multiple sheets data into one worksheet based on multiple criteria
    By hecgroups in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 01-05-2016, 10:32 AM
  6. Merge multiple excels with multiple sheets in a master excel with multiple sheets
    By marchi in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-15-2012, 10:37 AM
  7. Replies: 3
    Last Post: 03-03-2010, 03:41 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1