+ Reply to Thread
Results 1 to 6 of 6

Auto suggest only at times?

  1. #1
    Registered User
    Join Date
    07-25-2013
    Location
    Germany
    MS-Off Ver
    Excel 2013 64bit
    Posts
    29

    Auto suggest only at times?

    Hi all,

    here is my problem: When I type in "range." for example, vba automatically suggests commands in a dropdown menu. When I type in a previously declared (dim) own variable followed by a "." however, vba does not give suggestions.

    Also I dont get suggestions after an If statement for example

    Is there a way to change that?

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,532

    Re: Auto suggest only at times?

    VBA will give you a dropdown menu for attributes and methods of an object. If you declare a Range, it's an object. If you type the range name then "." VBA will give you a list of things that can follow the "."

    However, a scalar variable with a type like String, Integer, or Long, is not an object and so does not have attributes or methods. It is not valid syntax to follow it with a "."

    Can you give an example of a declared variable that you followed with a "." and did not get what you expected? And what would you want to see in that case?

    VBA will also prompt for certain things like a variable type in a Dim statement. You do not get suggestions for what comes after any other type of statement, including an If statement.

    I could be wrong but I have been using VBA for almost 10 years and have never found a way to configure this.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: Auto suggest only at times?

    In addition to what jeff said...

    its fully OOPS concept. if you define any class / object, then.. by "." you can ShowTip member of that object.
    IF is neither Class nor Enum..
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  4. #4
    Registered User
    Join Date
    07-25-2013
    Location
    Germany
    MS-Off Ver
    Excel 2013 64bit
    Posts
    29

    Re: Auto suggest only at times?

    @6string My bad, i declared my variable's value as Range("F7") and thought i could just write .ClearContents in a later statement behind the variable's name, instead of writing Range("F7") again. This didn't work, i had to specifically write Range.

    @debraj IF is neither Class nor Enum.. okay

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,532

    Re: Auto suggest only at times?

    Quote Originally Posted by Ventoux View Post
    @6string My bad, i declared my variable's value as Range("F7") and thought i could just write .ClearContents in a later statement behind the variable's name, instead of writing Range("F7") again. This didn't work, i had to specifically write Range.
    Let's clear up terms....you declare a variable's type and set its value. If you write code like this:

    Please Login or Register  to view this content.
    as soon as you type that "." you will get a list of class members for Range. You can also write
    Please Login or Register  to view this content.
    which is what I think you just said didn't work. If it didn't work you've got some other problem.

    @debraj IF is neither Class nor Enum.. okay
    "If" is a statement, not a class or enumerated value. So VBA will not give you any sort of prompt for what can go after it.

  6. #6
    Registered User
    Join Date
    07-25-2013
    Location
    Germany
    MS-Off Ver
    Excel 2013 64bit
    Posts
    29

    Re: Auto suggest only at times?

    Just saw your reply, thank you!

+ 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. Auto Filter By Times
    By realniceguy5000 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-14-2012, 01:41 PM
  2. Excel 2007 : Drop Down List (w/auto Suggest??)
    By FC3USN in forum Excel General
    Replies: 1
    Last Post: 06-09-2011, 01:15 PM
  3. Auto suggest
    By abis123 in forum Excel General
    Replies: 5
    Last Post: 04-05-2011, 02:13 PM
  4. Make Excel "auto suggest" words from a list
    By racer27x in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 03-16-2007, 11:11 AM
  5. How do I get auto suggest to work in Excel
    By KasiaT in forum Excel General
    Replies: 3
    Last Post: 04-13-2006, 07:47 AM

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