VBA Editor not autocompleting

eduzs

Well-known Member
Joined
Jul 6, 2014
Messages
704
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
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:
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


First you must declare the variable or the object appropriately.
For example


Code:
activesheet. (dont show)

Code:
dim sh as worksheet
set sh = activesheet
sh. (Show)
 
Last edited:
Upvote 0

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
First you must declare the variable or the object appropriately.
For example


Code:
activesheet. (dont show)

Code:
dim sh as worksheet
set sh = activesheet
sh. (Show)
Will produce an error if the active sheet is not a worksheet.
 
Upvote 0
No, I meant TypeName(Selection). After all, I did say:
If you were referring to post # 12 (which was the one immediately before yours) then it should be TypeName(ActiveSheet)
If you were referring some earlier posts re worksheet range selection then see post # 5
 
Upvote 0
Even if I select a range of cells "Selection." Intellisense does not work.

It doesn't matter what you selected before typing that. The Selection property returns a generic Object so there is no way for Intellisense to know what properties and methods might be available for whatever may end up being selected when the code actually runs.
 
Upvote 0
I understand, however, I think there is no reason why it should not work when the selected object is a range, with or without variable declaration, or in simple situations like "cells(1,1).", it is only basically a app limitation.
 
Upvote 0
How could the compiler possibly know at design time what would be selected at run time?

I agree that Cells.Item should provide intelligence since it will provide a Range object, but that's an object model limitation rather than an application one per se.
 
Upvote 0
Will produce an error if the active sheet is not a worksheet.

Can you show how an activesheet is not a worksheet?
And what error message does it send you?

This work for me

Code:
[COLOR=#333333][I]set sh = activesheet[/I][/COLOR]
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,169
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top