+ Reply to Thread
Results 1 to 16 of 16

Fill multiple comboboxes (10) from one source (sheet) and textboxes accordingly

  1. #1
    Registered User
    Join Date
    02-03-2016
    Location
    Algeria
    MS-Off Ver
    2016
    Posts
    20

    Fill multiple comboboxes (10) from one source (sheet) and textboxes accordingly

    Hi,

    Is there any way to fill 10 comboboxes from one source and get adjascent cells data from sheet in two textboxes.

    herewith a sample to clarify what i need


    thanks in advance,
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Fill multiple comboboxes (10) from one source (sheet) and textboxes accordingly

    It is possible but the meaning is not clear to me


    Kind regards
    Leo
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    02-03-2016
    Location
    Algeria
    MS-Off Ver
    2016
    Posts
    20

    Re: Fill multiple comboboxes (10) from one source (sheet) and textboxes accordingly

    Thank you .It is exactly what I need.What want to do is to make 2 invoicing forms :

    -One for simple invoice with one item and the other is for many items invoice and your help would be highly appreciated

    your code worked perfectly,but want to prevent entering duplicate invoice Number in column .How would it possible?

    THANK YOU IN ADVANCE
    Attached Files Attached Files

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Fill multiple comboboxes (10) from one source (sheet) and textboxes accordingly

    deleted post
    Attached Files Attached Files
    Last edited by mikerickson; 02-08-2016 at 10:18 AM.

  5. #5
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Fill multiple comboboxes (10) from one source (sheet) and textboxes accordingly

    This can be done with a custom class.
    Add a Class module and change its name to clsSomeComboBox and put this code in it.

    Please Login or Register  to view this content.
    Then put this code in the user form's code module. Note that the Art1_Change event has been removed, substituted by the ChangedComboBox_Change event.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by mikerickson; 02-07-2016 at 07:19 PM.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  6. #6
    Registered User
    Join Date
    02-03-2016
    Location
    Algeria
    MS-Off Ver
    2016
    Posts
    20

    Re: Fill multiple comboboxes (10) from one source (sheet) and textboxes accordingly

    Good morning,

    First of all,thank you very much for your replies and suggestions

    I have added a new form in which i could prevent duplicate number of invoice in column B ,but i could not do so in the other form (form5) could someone hel me to aply the same on the last one (InvN).

    Herewith my file modded.

    thanks in advance,
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    02-03-2016
    Location
    Algeria
    MS-Off Ver
    2016
    Posts
    20

    Re: Fill multiple comboboxes (10) from one source (sheet) and textboxes accordingly

    how to custom controls format to: Format(Qté1.Value, "#,##0.00")

  8. #8
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Fill multiple comboboxes (10) from one source (sheet) and textboxes accordingly

    Formatting textboxes isn't easy, but your format isn't one of the hard ones.
    I'll look at that when I get off work this afternoon.

  9. #9
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Fill multiple comboboxes (10) from one source (sheet) and textboxes accordingly

    By the way, do you want to allow the user to enter negative numbers or is the entry to be either 0 or positive?

  10. #10
    Registered User
    Join Date
    02-03-2016
    Location
    Algeria
    MS-Off Ver
    2016
    Posts
    20

    Re: Fill multiple comboboxes (10) from one source (sheet) and textboxes accordingly

    the entry SHOULD be either 0 or positive

  11. #11
    Registered User
    Join Date
    02-03-2016
    Location
    Algeria
    MS-Off Ver
    2016
    Posts
    20

    Re: Fill multiple comboboxes (10) from one source (sheet) and textboxes accordingly

    Quote Originally Posted by mikerickson View Post
    This can be done with a custom class.
    Add a Class module and change its name to clsSomeComboBox and put this code in it.

    Please Login or Register  to view this content.
    Then put this code in the user form's code module. Note that the Art1_Change event has been removed, substituted by the ChangedComboBox_Change event.
    Please Login or Register  to view this content.
    I have tested your code ,but it gives the following error:Compile error-variable not defined.jpgCompile error-variable not defined.jpg

  12. #12
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Fill multiple comboboxes (10) from one source (sheet) and textboxes accordingly

    That screen shot is too small for me to read.
    What does the error box say and what is the line that is highlighted?

  13. #13
    Registered User
    Join Date
    02-03-2016
    Location
    Algeria
    MS-Off Ver
    2016
    Posts
    20

    Re: Fill multiple comboboxes (10) from one source (sheet) and textboxes accordingly

    "Compile error:
    Variable not defined"------------with ComboBoxes = Array(Art1, Item2, Item3, Item4, Item5, Item6, Item7, Item8, Item9, Item10) and UniteBoxes = Array(Unit1 highlighted

  14. #14
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Fill multiple comboboxes (10) from one source (sheet) and textboxes accordingly

    Those should be the names of the combo boxes and their linked text boxes.
    I took them from the user form in post #3. If they have been changed in subsequent versions, they should be changed to match the new naming.

  15. #15
    Registered User
    Join Date
    02-03-2016
    Location
    Algeria
    MS-Off Ver
    2016
    Posts
    20

    Re: Fill multiple comboboxes (10) from one source (sheet) and textboxes accordingly

    herewith my file so far and thanks in advance
    Attached Files Attached Files

  16. #16
    Registered User
    Join Date
    02-03-2016
    Location
    Algeria
    MS-Off Ver
    2016
    Posts
    20

    Re: Fill multiple comboboxes (10) from one source (sheet) and textboxes accordingly

    Herewith the progress I have made so far
    Attached Files Attached Files
    Last edited by djemy1975*; 02-10-2016 at 01:46 PM.

+ 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. Fill multiple comboboxes with same values
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-13-2017, 01:55 AM
  2. userform with 3 comboboxes and textboxes send to sheet
    By cfinch100 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-15-2013, 03:15 PM
  3. Can I use one fill code to fill comboboxes in multiple forms?
    By 0612Man in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-18-2012, 02:57 PM
  4. Working with Textboxes and or Comboboxes
    By Rick_Stanich in forum Access Programming / VBA / Macros
    Replies: 0
    Last Post: 11-06-2009, 11:07 AM
  5. How to empty all comboboxes and textboxes in a userform
    By LoveCandle in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-06-2009, 02:28 AM
  6. Textboxes and ComboBoxes
    By Jason Zischke in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-05-2006, 09:35 PM
  7. Clear Comboboxes & Textboxes
    By MBlake in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 05-02-2005, 06:06 PM
  8. Can I convert ComboBoxes to TextBoxes?
    By PCLIVE in forum Excel General
    Replies: 2
    Last Post: 04-13-2005, 02:06 PM

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