+ Reply to Thread
Results 1 to 3 of 3

Variable not defined error

  1. #1
    Forum Contributor
    Join Date
    11-17-2004
    MS-Off Ver
    Office 2016
    Posts
    527

    Variable not defined error

    I have a small piece of code that works fine however when I select the Compile VBAProject option I receive the error "Variable not defined" for the item ComboBox1 listed within the parenthesis. I'd like to make sure the rest of my code compiles correctly but it seems I need to get past this bit first. I'm not sure how to define the combobox itself as a variable.


    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,414

    Re: Variable not defined error

    Is your combobox on a userform or on a tab?
    Where is your code? is a standard module? a userform module? a worksheet module?

    Note: if your combobox and your code are both in a userform it works.
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

  3. #3
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Variable not defined error

    Please Login or Register  to view this content.

    Note: I don't see where you are doing anything with the variable? Is it a public variable? What are you trying to achieve with the code?
    Last edited by Solus Rankin; 08-22-2013 at 01:43 PM. Reason: cleaned code
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Error Variable Not Defined
    By DKTRL in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-05-2013, 03:22 PM
  2. [SOLVED] Variable not defined error
    By janeml in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-07-2013, 07:36 PM
  3. variable not defined error
    By amartino44 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-16-2013, 06:39 PM
  4. Variable not defined error when I have defined the variable
    By jeffadkisson in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-27-2012, 07:00 PM
  5. variable not defined error
    By jw01 in forum Excel General
    Replies: 1
    Last Post: 01-28-2011, 03:29 PM

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