Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

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

  1. #11
    Board Regular
    Join Date
    Feb 2002
    Posts
    255
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Or post all of your code and we can tell you what needs to be modified. It's pretty clear Mark's earlier theory is correct; for what you are doing, you should NOT have both a combobox change event (Sub ComboBox1_Change()) and a command button (Sub CommandButton1_Click()). One or the other will do the job, both will mess you up.

    Dave

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

    Default

    I've got books in front of me but they haven't helped. It is actually working now but the one other problem I've had is that the spreadsheet has repeated items. so to solve this problem I added a new sheet called items which listed all the headings and I used the rowSource - items!a2:a30.

    Can I add this to your code as all it is doing at the moment is picking out

  3. #13
    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

    You can add whatever you want to the code.

    What books have you got in front of you? I'm curious because there are some pig-awful books out there.

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

    Default

    Well I am well and truely messed up davers5.

    Ok this is what I have done:
    I have gone into VBA and inserted a user form Private sub UserForm_Click(), I changed the caption to Item Search and the name to frmSearch.

    Then I inserted a drop down box - Private Sub UserForm_Click().

    I then went to the properties menu and put Items!a2:a30 in the RowSource box, which puts the items in the drop down list.

    I now need to put the code in so that when I click on the items it brings up all the chairs in my spreadsheet, desks, tabes etc.

    I've got two codes I could use (but where do I put it?)

    1. Selection.AutoFilter Field:=3, Criteria1:="Bookcase

    2. ActiveWorkbook.CustomViews("Bookcase").show

    You lot are life savers

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

    Default

    I'm being taught using 'Microsoft Excel2000 Visual Basic for Applications - Fundamentals by Reed Jacobson

  6. #16
    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

    That's one of the pig awful books I'm afraid. Who's teaching you this? College or something? (sorry for going off topic, but this sounds like the solution is going to be a lot more involved than I have the time for just now)

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

    Default

    University. It was my tutor that told me to put in the command button as well as the dropdown list. She made it work on her's.

    I just don't know where to put in the

    Selection.AutoFilter Field:=3, Criteria1:="Bookcase"

    and how to change from Bookcase to breakfast table when I click on the breakfast table in the drop down list.

  8. #18
    Board Regular
    Join Date
    Feb 2002
    Posts
    255
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    It sounds like you should be using a database and not excel. This would be a simple solution in access (a matter of writing a simple query). Like Mark says, this is a complex problem and we don't even know what your data looks like. It's one thing to get a combobox that works and selects or prints a single value, it's quite another to select every instance of "chair" in your spreadsheet from a combobox.

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
  •