VBA Editor not autocompleting
Page 1 of 4 123 ... LastLast
Results 1 to 10 of 33

Thread: VBA Editor not autocompleting

  1. #1
    Board Regular
    Join Date
    Jul 2014
    Location
    Anywhere
    Posts
    450
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default VBA Editor not autocompleting

    Why is my VBA Excel editor not autocompleting while I type the code?
    For example: if I type "Selection". I'll usually expect to see the list of things I can do with it.
    Maybe I disabled any setting?

    Thanks
    Last edited by eduzs; Jun 16th, 2019 at 08:03 PM.
    Using Excel/Word 2010.
    Backup your original file before doing any modification.

  2. #2
    Board Regular
    Join Date
    Sep 2016
    Posts
    2,565
    Post Thanks / Like
    Mentioned
    36 Post(s)
    Tagged
    1 Thread(s)

    Default Re: VBA Editor not autocompleting


  3. #3
    MrExcel MVP
    Moderator
    RoryA's Avatar
    Join Date
    May 2008
    Location
    UK
    Posts
    33,737
    Post Thanks / Like
    Mentioned
    48 Post(s)
    Tagged
    6 Thread(s)

    Default Re: VBA Editor not autocompleting

    Selection could be any type of object, so Intellisense can't really help you with that.

  4. #4
    Board Regular
    Join Date
    Jul 2014
    Location
    Anywhere
    Posts
    450
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: VBA Editor not autocompleting

    Thanks all! I did not know it name is Intellisense.
    And yes, VBA can't know what is the object.
    Thanks.
    Last edited by eduzs; Jun 17th, 2019 at 05:49 AM.
    Using Excel/Word 2010.
    Backup your original file before doing any modification.

  5. #5
    Board Regular
    Join Date
    Sep 2016
    Posts
    2,565
    Post Thanks / Like
    Mentioned
    36 Post(s)
    Tagged
    1 Thread(s)

    Default Re: VBA Editor not autocompleting

    To get intellisense based on selection, would need like this (using a range object for purpose of example) :
    Code:
    Dim rng As Range
    If TypeName(Selection) = "Range" Then
        Set rng = Selection
        rng.
    End If
    Last edited by footoo; Jun 17th, 2019 at 07:27 AM.

  6. #6
    Retired Moderator Macropod's Avatar
    Join Date
    Aug 2007
    Location
    Canberra, Australia
    Posts
    3,280
    Post Thanks / Like
    Mentioned
    6 Post(s)
    Tagged
    1 Thread(s)

    Default Re: VBA Editor not autocompleting

    Excel's Intellisense seems lame by comparison with Word in this area, where Intellisense works quite happily even for Selection.
    Cheers
    Paul Edstein
    [MS MVP - Word]

  7. #7
    MrExcel MVP
    Moderator
    RoryA's Avatar
    Join Date
    May 2008
    Location
    UK
    Posts
    33,737
    Post Thanks / Like
    Mentioned
    48 Post(s)
    Tagged
    6 Thread(s)

    Default Re: VBA Editor not autocompleting

    That's a difference in the OM. In Word, there is a Selection class whereas there isn't in Excel, where I guess there are perhaps more options for what the selection might be, though I confess I have no idea how most of the selection properties would behave if you hadn't selected some text.

  8. #8
    Board Regular
    Join Date
    Jul 2014
    Location
    Anywhere
    Posts
    450
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: VBA Editor not autocompleting

    Quote Originally Posted by Macropod View Post
    Excel's Intellisense seems lame by comparison with Word in this area, where Intellisense works quite happily even for Selection.
    I also think this, Intellisense works much more in Word.
    Even a simple "cells(1,1)." Intellisense does not work, but works in "Range("A1")."
    Even if I select a range of cells "Selection." Intellisense does not work.
    Thanks
    Last edited by eduzs; Jun 17th, 2019 at 07:48 PM.
    Using Excel/Word 2010.
    Backup your original file before doing any modification.

  9. #9
    Board Regular
    Join Date
    Jul 2014
    Location
    Anywhere
    Posts
    450
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: VBA Editor not autocompleting

    Quote Originally Posted by footoo View Post
    To get intellisense based on selection, would need like this (using a range object for purpose of example) :
    Code:
    Dim rng As Range
    If TypeName(Selection) = "Range" Then
        Set rng = Selection
        rng.
    End If
    Thanks! You're right if I plan to use Intellisense I need firstly set selection as a range variable object.

    Code:
    Dim oRng As Range
    Set oRng = Selection
    Debug.Print oRng.Cells.Count
    Using Excel/Word 2010.
    Backup your original file before doing any modification.

  10. #10
    Board Regular
    Join Date
    Sep 2016
    Posts
    2,565
    Post Thanks / Like
    Mentioned
    36 Post(s)
    Tagged
    1 Thread(s)

    Default Re: VBA Editor not autocompleting

    Quote Originally Posted by eduzs View Post
    Thanks! You're right if I plan to use Intellisense I need firstly set selection as a range variable object.

    Code:
    Dim oRng As Range
    Set oRng = Selection
    Debug.Print oRng.Cells.Count
    If the selection is it not a range, this code will produce an error.
    To avoid this, need to check that the selection is a range object (see post # 5).

Some videos you may like

User Tag List

Tags for this Thread

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
  •