Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Is there anyone that can help...!!!!????

  1. #1
    New Member
    Join Date
    Apr 2002
    Posts
    43
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I've produced a userform with a drop-down list with items such as chair, table, bed etc. When i select one of them (eg. chair) , and press the command button to select the item, it flashes up with all of them and goes back to the original chosen one.

    HELP! Whats going on?!

    How do i get them to show up on the spreadsheet individually??!!!

  2. #2
    MrExcel MVP Mark O'Brien's Avatar
    Join Date
    Feb 2002
    Location
    Columbus, OH, USA
    Posts
    3,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Do you have any code on the userform pertaining to the list? I'm guessing that you may have something in the listbox "change" event that resets the selection.

  3. #3
    New Member
    Join Date
    Apr 2002
    Posts
    43
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    At the moment all ive got is a userform with a drop down list which has got all my item headings within it.

    Im now trying to produce a command button that when you select from the drop down list the item and press the command butoon it takes you to that item in the spreadsheet. This isnt working at the moment!

  4. #4
    MrExcel MVP Mark O'Brien's Avatar
    Join Date
    Feb 2002
    Location
    Columbus, OH, USA
    Posts
    3,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Put this code on your userform:


    Private Sub ListBox1_Click()
    Dim oRange As Range
    Set oRange = ActiveSheet.UsedRange.Find(what:=Me.ListBox1.Text)
    oRange.Activate
    End Sub


    Change "ListBox1" to whatever the name of your listbox is. I've assumed that the active worksheet will house the data that is in the listbox.

    HTH

  5. #5
    MrExcel MVP Mark O'Brien's Avatar
    Join Date
    Feb 2002
    Location
    Columbus, OH, USA
    Posts
    3,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I may have picked up your post wrong. That previous code was for a "Listbox", I think that you may have a "ComboBox" (dropdown list).

    Use this code if you have a combobox (put it on the userform):


    Private Sub ComboBox1_Change()
    Dim oRange As Range
    Set oRange = ActiveSheet.UsedRange.Find(what:=Me.ComboBox1.Text)
    oRange.Activate
    End Sub


    Change "ComboBox1" to whatever the name of your combobox is.

  6. #6
    New Member
    Join Date
    Apr 2002
    Posts
    43
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Whats oRange ??

  7. #7
    Board Regular zacemmel's Avatar
    Join Date
    Apr 2002
    Location
    Redmond, WA
    Posts
    636
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    IMO I think Frankie needs to call 1-888-SOLPROV. They should have an answer for him/her.

  8. #8
    New Member
    Join Date
    Apr 2002
    Posts
    43
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    also; where do i put this code.

    Ive got a 'private Sub ComboBox1_Change ()'

    ive also got another heading; Command button which is

    'private Sub CommandButton1_Click ()'

  9. #9
    MrExcel MVP Mark O'Brien's Avatar
    Join Date
    Feb 2002
    Location
    Columbus, OH, USA
    Posts
    3,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-05-01 11:13, Frankie needs HELP wrote:
    also; where do i put this code.

    Ive got a 'private Sub ComboBox1_Change ()'

    ive also got another heading; Command button which is

    'private Sub CommandButton1_Click ()'
    Highlight all of your code and copy and paste my code to replace it. (assuming that the lines of code you've quoted are the only lines you have there, apart from the associated "End Sub"'s)

  10. #10
    MrExcel MVP Mark O'Brien's Avatar
    Join Date
    Feb 2002
    Location
    Columbus, OH, USA
    Posts
    3,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-05-01 11:02, Frankie needs HELP wrote:
    Whats oRange ??
    "oRange" is a variable that I've declared that will hold the address of the cell that contains the combobox value.

    To be honest, it sounds like you're going to need to get an Excel VBA book to get you started. Have a look at some of MrExcel's recommendations:

    http://www.mrexcel.com/book.shtml

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •