+ Reply to Thread
Results 1 to 12 of 12

help me in modify this code for combining data in listbox on userform and calculate?

  1. #1
    Registered User
    Join Date
    10-16-2021
    Location
    egypt
    MS-Off Ver
    2016
    Posts
    75

    help me in modify this code for combining data in listbox on userform and calculate?

    Use this code to merge the data based on the name of the product in column No. 8 (H), and collect the data in columns 13 and 14, and the merge appears in a sheet named Temp and appears in the list box.
    The problem is that when the supposed combination appears, 6 products appear, but what happens is that only 3 appear
    Attached Files Attached Files
    Last edited by saftawy1; 03-13-2023 at 11:22 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: help me in modify this code for combining data in listbox on userform and calculate?

    Hi saftawy1. It will be difficult to help you:

    a) You say you have 6 items but you have 5.

    b) In the 'Temp' sheet, the 'Binder' element counts 509 units, but its pivot table says it is 722.

    c) On the 'Temp' sheet, the 'Binder' element appears with Rep = Morgan but on the 'SH1' sheet it has Andrews, Gill, Howard, Jardine, Jones, Kivell, Morgan, Parent, Smith, Sorvino and Thompson.

    In summary:
    1) Your VBA code doesn't matter.
    2) Upload a workbook again to the Forum with the expected end result.
    3) Explain -exactly- what type of filter you want to apply in your user form.
    You are always very welcome if you add reputation by clicking the * (bottom left) of each message that has helped you.

  3. #3
    Registered User
    Join Date
    10-16-2021
    Location
    egypt
    MS-Off Ver
    2016
    Posts
    75

    Re: help me in modify this code for combining data in listbox on userform and calculate?

    Thank you beyond Excel for your interest. I checked all points and found that the code does not achieve what I want
    Therefore, I modified what appears in the list box, which is the columns from H to P only, and what is required is to merge this data if Button 1 is chosen according to the return H with File or the first column in the listbox for the item and collect the other columns except for the two columns J and L to take an average for them as it is Shown in pivot table, I Uploaded a new workbook
    And thank you very much
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: help me in modify this code for combining data in listbox on userform and calculate?

    .
    See if what I attached helps you:
    Attached Files Attached Files
    Last edited by beyond Excel; 03-13-2023 at 05:03 PM.

  5. #5
    Registered User
    Join Date
    10-16-2021
    Location
    egypt
    MS-Off Ver
    2016
    Posts
    75

    Re: help me in modify this code for combining data in listbox on userform and calculate?

    When opening the file for the first time and trying to open the form, it gave me an error as in the first picture, and when closing the file and opening it a second time, and trying to open the form, it gave me the error as in the second picture.
    Thanks beyond Excel
    Attached Images Attached Images
    Last edited by saftawy1; 03-14-2023 at 08:18 AM.

  6. #6
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: help me in modify this code for combining data in listbox on userform and calculate?

    The links to your images don't work.

  7. #7
    Registered User
    Join Date
    10-16-2021
    Location
    egypt
    MS-Off Ver
    2016
    Posts
    75

    Re: help me in modify this code for combining data in listbox on userform and calculate?

    i upload a new picture with the 2 errors
    thank you
    Attached Images Attached Images
    Last edited by saftawy1; 03-14-2023 at 08:47 AM.

  8. #8
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: help me in modify this code for combining data in listbox on userform and calculate?

    I see your Excel is from Office 2016.
    But - this is what you have to comment on - it seems to be a 64-bit Office.

    If so, then 32-bit components such as the ListView used are not supported and I would have to change everything and use a ListBox instead.

  9. #9
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: help me in modify this code for combining data in listbox on userform and calculate?

    Personally, while I may have a setup similar to yours, I prefer to use 32-bit Office to avoid these limitations.

  10. #10
    Registered User
    Join Date
    10-16-2021
    Location
    egypt
    MS-Off Ver
    2016
    Posts
    75

    Re: help me in modify this code for combining data in listbox on userform and calculate?

    it is 32 bit
    Attachment 821646

    ty beyond Excel
    Attached Images Attached Images
    Last edited by saftawy1; 03-14-2023 at 04:20 PM.

  11. #11
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: help me in modify this code for combining data in listbox on userform and calculate?

    .
    But that's great: one less problem!...

    In case you can't find the correct reference, you should download the MSCOMCTL.OCX control from the https://www.fmsinc.com/MicrosoftAcce...rols/mscomctl/ site and follow the steps in this tutorial.

  12. #12
    Registered User
    Join Date
    10-16-2021
    Location
    egypt
    MS-Off Ver
    2016
    Posts
    75

    Re: help me in modify this code for combining data in listbox on userform and calculate?

    ok ty i will try that

+ 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] userform dynamic listbox to add & modify data
    By adamheon in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-19-2017, 11:10 PM
  2. Userform code to show data in listbox if criteria met
    By ExcelFailure in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-07-2016, 08:12 AM
  3. Excel userform - vba code to modify datasheet
    By mariec_06 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-26-2016, 05:26 PM
  4. Modify code to run from sheet instead of userform
    By solidus.it in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-25-2015, 05:59 PM
  5. combining code to have userform get data from 1 sheet and transfer to another
    By James__S in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-27-2014, 03:26 AM
  6. Transfer Data From One Userform Listbox to Another Userform Listbox with 11 columns
    By sparkoft in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 05-18-2013, 10:54 AM
  7. Listbox to Listbox, no duplicates & submitting same UserForm data for each Listbox entry.
    By jamieswift1977 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-18-2012, 12:18 PM

Tags for this Thread

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