+ Reply to Thread
Results 1 to 8 of 8

Help with combobox

  1. #1
    Registered User
    Join Date
    01-11-2007
    Posts
    17

    Smile Help with combobox

    I have 5 combo boxes on one sheet.
    Is possible to change the index numbers?

    I have
    cbo1 1,2,3,4,5
    cbo2 1,2,3
    cbo3 1,2,3,4

    but I need

    cbo1 1,2,3,4,5
    cbo2 6,7,8
    cbo3 9,10,11,12

    Also, in a macro, how can I check if one combobox is selected?
    I need to copy the values of the celllinks into a db, but if one cbo is not selected the macro must stop, delete the inserted row and alert the user.

    Thanx

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by Dexx
    I have 5 combo boxes on one sheet.
    Is possible to change the index numbers?

    I have
    cbo1 1,2,3,4,5
    cbo2 1,2,3
    cbo3 1,2,3,4

    but I need

    cbo1 1,2,3,4,5
    cbo2 6,7,8
    cbo3 9,10,11,12

    Also, in a macro, how can I check if one combobox is selected?
    I need to copy the values of the celllinks into a db, but if one cbo is not selected the macro must stop, delete the inserted row and alert the user.

    Thanx
    Hi,

    this could be a case where a sample of your sheet (with your data removed) could be most useful, can you Copy the sheet and post a zip'd version here.

    ---
    Si fractum non sit, noli id reficere.

  3. #3
    Registered User
    Join Date
    01-11-2007
    Posts
    17
    here is a sample
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by Dexx
    here is a sample
    Hi,

    just add a 'If' as per
    Please Login or Register  to view this content.
    Let me know how this goes

    ---
    added, for the '6 7 8' & 9 10 11 12' the values in column L & M can be adjusted by you to suit your requirements, the cbo will display what you enter.
    ---
    Last edited by Bryan Hessey; 01-12-2007 at 07:21 PM.

  5. #5
    Registered User
    Join Date
    01-11-2007
    Posts
    17
    That's what I needed. Thanx.

    Just another Q about sheets.
    I have about 15 sheets with a codeName (not tab name) Player1, Player2 Player3.

    I need in a macro to do something like this:

    Please Login or Register  to view this content.
    I recive an error that an Object is required

  6. #6
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by Dexx
    That's what I needed. Thanx.

    Just another Q about sheets.
    I have about 15 sheets with a codeName (not tab name) Player1, Player2 Player3.

    I need in a macro to do something like this:

    Please Login or Register  to view this content.
    I recive an error that an Object is required
    If I read that correctly, you are trying to set an array of Players, and then select something, probably a Sheet, according to the selected item.

    I have not used arrays as "Players(1) = "Player2" "
    but if the system allowed that, then try to select the object, viz


    myPlayer = Players(num)
    msgbox myPlayer & " to check"
    myPlayer.select

    that doesn't work, more tomorrow
    ---
    amended, for CodeName
    Last edited by Bryan Hessey; 01-13-2007 at 09:36 AM.

  7. #7
    Registered User
    Join Date
    01-11-2007
    Posts
    17
    Yes, Players are sheets

    Let's say that I have 2 Sheets Named Player1 and Player2 (renaming the tab at the bottom.

    This code Works:

    Dim Num
    Dim Players(1) as Variant
    Players(0) = "Player1"
    Players(1) = "Player2"

    For Num = 0 To 1
    Sheets(Players(Num)).Select
    -- actions --
    Next Num



    But if one day I change the tab "Player1" into "Michael Jordan" the code above will not work.

    What I need is to use the codeName of the Sheet, the value in (name)

    At the end all that i need is a collection of sheets

  8. #8
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by Dexx
    Yes, Players are sheets

    Let's say that I have 2 Sheets Named Player1 and Player2 (renaming the tab at the bottom.

    This code Works:

    Dim Num
    Dim Players(1) as Variant
    Players(0) = "Player1"
    Players(1) = "Player2"

    For Num = 0 To 1
    Sheets(Players(Num)).Select
    -- actions --
    Next Num



    But if one day I change the tab "Player1" into "Michael Jordan" the code above will not work.

    What I need is to use the codeName of the Sheet, the value in (name)

    At the end all that i need is a collection of sheets
    Using Codename, it works as
    Please Login or Register  to view this content.
    added, but your need for this might have been obviated by your other post (Collection of Sheets using the CodeName ).
    ---
    Last edited by Bryan Hessey; 01-14-2007 at 05:36 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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