+ Reply to Thread
Results 1 to 5 of 5

how to make activecell be populated by userform depended on which combobox has a value in

  1. #1
    Forum Contributor sspreyer's Avatar
    Join Date
    07-05-2013
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    178

    how to make activecell be populated by userform depended on which combobox has a value in

    hi all

    i have some code that when i click a command button on a userform it fill the activecell with a value problem is there 3 combo boxs on my userform
    but i would only like whatever combobox has value in it put in the active cell you can see better by look at my code for some reason it works with combox 1 and 3 not 2 tho.

    thanks
    for your help in advance

    Please Login or Register  to view this content.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,192

    Re: how to make activecell be populated by userform depended on which combobox has a value

    Hi, sspreyer,

    and what will happen if two comboboxes are filled? I tend to not put values from fdifferent sources into one cell, sound to me that maybe the design should be revised. I especially feel uncomfortable using ActiveCell for placing values in a worksheet.

    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Contributor sspreyer's Avatar
    Join Date
    07-05-2013
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    178

    Re: how to make activecell be populated by userform depended on which combobox has a value

    hi Holger
    thanks for your help works great your code only one problem if user hits the command button and has not fill any of the combo box's it gets run time error could not find specified object. Is there away of puting an msbox box saying please fill one of the boxs perhap "on error" thanks for help holger you legend

    shane

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,192

    Re: how to make activecell be populated by userform depended on which combobox has a value

    Hi, shane,

    maybe alter the code to check for lngNumber to be greater 0 (which means that any CB has a value) to write the value or display a MegBox:
    Please Login or Register  to view this content.
    Ciao,
    Holger

  5. #5
    Forum Contributor sspreyer's Avatar
    Join Date
    07-05-2013
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    178

    Re: how to make activecell be populated by userform depended on which combobox has a value

    Thanks Holger for your help yet again legend!!!!!!!!!!!!!!!!!!!

+ 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] Make combobox list options dependant on selection in another combobox within a userform
    By Vladimir_Dobvchenko in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-23-2013, 05:30 AM
  2. [SOLVED] how to make userforms pop up depended on value enter
    By sspreyer in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-27-2013, 12:31 PM
  3. [SOLVED] How do I make a selection from a combobox on my VBA userform populate a textbox?
    By ChristianMba in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-16-2012, 01:08 PM
  4. Populated problem in combobox UserForm Excel
    By herukuncahyono in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-23-2009, 01:01 AM
  5. Make lists in Combobox (userform) depend on each other
    By nalfin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-17-2009, 07:24 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