+ Reply to Thread
Results 1 to 3 of 3

Simple VBA Degub help

  1. #1
    Registered User
    Join Date
    01-24-2013
    Location
    NSW
    MS-Off Ver
    Excel 2010
    Posts
    2

    Simple VBA Degub help

    I am learning VBA using the dummies book, but need this to work now and would appreciate any help, it seems like it should be a simple answer.
    Please Login or Register  to view this content.
    This code is just to make a text box appear or disappear depending on what is selected in a combo fox. SOMETIMES (but not always) when people open this spreadsheet i get 4 warnings for the 4 appearances of this code, with the opportunity to debug and it highlights the line:
    Please Login or Register  to view this content.
    My theory is that this error's appearance is connected to whether the text boxes have been manually adjusted to true/false visibility in the properties box but im not sure. Could be missing something simple!

    Thanks for any help.

    Sincerely,

    Alex
    Last edited by Leith Ross; 01-24-2013 at 04:23 PM. Reason: Added Code tags

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Simple VBA Degub help

    Hello Alex,

    Welcome to the Forum!

    There are two types of controls that can be placed on an Excel worksheet: Forms and ActiveX. It is not possible to tell which you are using from the posted code or where the code is located.

    You should post a copy of the workbook. This will provide you with a fast working solution.

    To Post Your Workbook
    1. At the bottom right of the Reply window, Click the button Go Advanced
    2. At the top of the Your Message Window, in the first row of icons, Click the Paperclip icon.
    3. Click the Add Files button at the top right in the dialog box. This displays the File Manager dialog.
    4. Click the Select Files button at the bottom middle of the dialog.
    5. In the new window Find the file you want to upload, select it, and Click Open.
    6. You will now be back in the File Manager dialog. Click the bottom Middle button Upload File.
    7. Wait until the file has completely uploaded before you exit the File Manager dialog.

    File Manger Pic
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    01-24-2013
    Location
    NSW
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Simple VBA Degub help

    Thanks for the response!

    I am using active X controls, and I believe there is a reason I chose that over forms but i am not totally sure.

    I cannot attach the actual file because it's for the company. I have attached a file with the problem in it. What is really confusing me is that I can open this spreadsheet without problems most of the time. Other people will get the error to appear. I will get it to appear at random times like when i just tried to cut and paste a named range ( not one valid to the debug error)

    I would also like to add a line that clear the contents of the text box when the combobox <> Other (Specify)

    Thanks so much for the support, I am half way through the dummies guide!

    Alex

    EDIT: The problem might be along the lines of needing to declare the active object? Something like With Active.Sheet.
    Attached Files Attached Files
    Last edited by Lovallo; 01-25-2013 at 01:19 PM. Reason: file upload

+ 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