+ Reply to Thread
Results 1 to 11 of 11

getting a worksheet from a combo box.

  1. #1
    Registered User
    Join Date
    11-01-2024
    Location
    Royal Wootton Bassett
    MS-Off Ver
    Office 15
    Posts
    5

    Angry getting a worksheet from a combo box.

    Hi,
    I have a form (Data_Input) on this form I have 2 X Combo Boxes ( CMB Name & CMB Team).
    When I press the enter button I want to go to the worksheet selected in CMB Name, then find The team in Column "N" that is from CMB Team.
    I then want to add data so I will Offset this.
    Many thanks

  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
    29,968

    Re: getting a worksheet from a combo box.

    Fast answers need clear examples.

    Post a small Excel sheet (not a picture) showing realistic & representative sample data WITHOUT confidential information (10-20 rows, not thousands...) and some manually calculated results. For a new thread (1st post), scroll to Manage Attachments, otherwise scroll down to GO ADVANCED, click, and then scroll down to MANAGE ATTACHMENTS and click again. Now follow the instructions at the top of that screen.
    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 Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,209

    Re: getting a worksheet from a combo box.

    As JohnTopley wrote above, but you can try the following scheme:
    User form module
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    11-01-2024
    Location
    Royal Wootton Bassett
    MS-Off Ver
    Office 15
    Posts
    5

    Re: getting a worksheet from a combo box.

    Stat trial.xlsm

    Not sure if it has attached?
    It looks a bit messy, just need the code then I can tidy it up.
    Cheers
    John

  5. #5
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Prof Plus 2019
    Posts
    6,989

    Re: getting a worksheet from a combo box.

    I suppose you meant Column B because Column N is empty.

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  6. #6
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,454

    Re: getting a worksheet from a combo box.

    Your comboboxes are populated with non space names and the actual sheet names have spaces and vice versa for Team names
    So fix that up and then this can be adapted to work...Adapting from bakerman2

    I also...personal preference...keep all controls at default names...so much easier to manipulate and loop through if needed...
    Is a nightmare having to remember each individula control name...

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Sintek; 11-01-2024 at 01:38 PM.
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  7. #7
    Registered User
    Join Date
    11-01-2024
    Location
    Royal Wootton Bassett
    MS-Off Ver
    Office 15
    Posts
    5

    Re: getting a worksheet from a combo box.

    Hi Sintek,
    The values are not coming across as a Number, it wants me to change them to a number manually (Long Job), is there anyway this can be done using VBA?
    Sorry to be a pain.
    Cheers
    John

  8. #8
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,454

    Re: getting a worksheet from a combo box.

    Hi Sintek,
    The values are not coming across as a Number, it wants me to change them to a number manually
    Please elaborate...I have no idea what you mean...

  9. #9
    Registered User
    Join Date
    11-01-2024
    Location
    Royal Wootton Bassett
    MS-Off Ver
    Office 15
    Posts
    5

    Re: getting a worksheet from a combo box.

    When I put a number into a textbox on the form, it shows on the worksheet as a number with the green triangle in the corner, I then have to click on it to transfer to a number.

  10. #10
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,454

    Re: getting a worksheet from a combo box.

    I dont know what your code snippet is but my guess...Add the red snippet as the content of a textbox is always a string...
    Please Login or Register  to view this content.
    Last edited by Sintek; 11-03-2024 at 08:34 AM.

  11. #11
    Registered User
    Join Date
    11-01-2024
    Location
    Royal Wootton Bassett
    MS-Off Ver
    Office 15
    Posts
    5

    Re: getting a worksheet from a combo box.

    Sintek.
    I new it was that easy.
    Many thanks
    John

+ 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] Excel 2010 VBA – Combo Box Options– Clear cell/box in 2nd Combo when 1st Combo selected
    By theshybutterfly in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-17-2013, 07:25 PM
  2. Get combo box value (worksheet combo box) by index number
    By randell.graybill in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-07-2012, 12:09 AM
  3. Refer to worksheet combo box
    By kt1978 in forum Excel General
    Replies: 1
    Last Post: 01-31-2011, 07:16 AM
  4. Use combo box in excel worksheet
    By iansl2000 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-30-2009, 12:40 PM
  5. combo box with reference name on the worksheet
    By pichai in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-17-2008, 08:08 AM
  6. Combo Box In Worksheet
    By raywood in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-11-2007, 10:03 AM
  7. Populate a combo box from a worksheet with VBA
    By Jack in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-13-2006, 08:50 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