Consulting

Results 1 to 5 of 5

Thread: VBA Excel Helper Subprocedures;Homework

  1. #1
    VBA Student VBAX Regular
    Joined
    Mar 2008
    Posts
    20

    VBA Excel Helper Subprocedures;Homework

    Recently, i need help with my homework. It's getting really tough and i don't get it. However, I'm in my last section for it. SO YIPPE. I know I've made mistakes that I should of realized. So, i hope mod's or repliers aren't mad at me.

    So, here is my cmdSelect button. I think it's more clear, if you see the downloaded attachment, I provided.

    Once i clicked the cmdSelect button is that it is not defined. But, i asked my tutor and he told me not define it. I wanted more help from him, but my computer ran out of juice.

    So, what the cmdSelect button does, is when a user inputs a product and the type of product into the fields, a msgbox comes up and says thanks for voting. But, it will probably be more clear to you guys, when you look at it.

  2. #2
    VBA Student VBAX Regular
    Joined
    Mar 2008
    Posts
    20
    Help please?

  3. #3
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Where are your code comments? I've no idea what your code is meant to do and I've no time to waste deciphering it. How would you expect to maintain this in a year's time?

    Fix your errors one at a time. Comment out offending lines until there are no compile errors, then fix things in turn and step through your code.

    "Cells" requires a sheet reference.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  4. #4
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    To help you test code, Microsoft Visual Basic provides a special window called the Immediate Window. To display the Immediate Window, when you are in the VBE (Visual Basic Editor, use Alt+F11), you can click View -> Immediate Window. Look here for some help on it. To comment a line (say what the line does) type a ' then your short description, the ' tells excel to ignore this line, so if you have faulty lines of code add a ' in front and excel ignores them, however if you say did this:
    [VBA]
    'If Range("A1")="d" Then
    [/VBA]then you would cause another error because you will have an End IF without an If so as md says comment out further lines until you can compile your code and it shows no error then work on from there!
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  5. #5
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Good link Simon.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

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