Questions tagged [vbe]

Visual Basic Editor is the built in IDE for writing VBA. It is hosted by various MS Office programs. Use this tag for general questions about the IDE or the Microsoft VBA Extensibility Library (VBIDE) which allows automation of the Visual Basic for Applications Editor.

Visual Basic Editor is the built in IDE for writing VBA. It is hosted by various MS Office programs. Use this tag for general questions about the IDE or the Microsoft VBA Extensibility Library (VBIDE) which allows automation of the Visual Basic for Applications Editor.

VBE has three key elements: Code window (on the right); Projects window (top left), and Properties window (bottom left). Example for Excel:

VBE example

Others may be added, for example for Watches.

217 questions
4
votes
2 answers

How does VBE immediate window handle literal numbers?

Using the immediate window to do some debugging, I came across the following which I have simplified for the purpose of this question: running this command: ?20000*2 produces an 'overflow' error. Let's assume this is because we haven't declared a…
SierraOscar
  • 17,507
  • 6
  • 40
  • 68
4
votes
1 answer

VBA debugger precision

I had a single which I believe the C++ equivalent is float in VBA in an Excel workbook module. Anyways, the value I originally assigned (876.34497) is rounded off to 876.345 in the Immediate Window, and Watch, and hover tooltip when I set a…
user17753
  • 3,083
  • 9
  • 35
  • 73
3
votes
2 answers

How to break up a long formula in VBA editor?

I have a macro that adds a very long formula to one of the cells. Is there a way to break up this formula in the VBA editor to make it easier to view and edit. Sheet3.Select Dim lastrow As Long Range("D2").Formula =…
Ziggs
  • 33
  • 3
3
votes
2 answers

VBE Intellisense for named ranges

What is a good practice of getting the named ranges of my sheet from VBE Intellisense? I have created a workaround of getting the named range from the class module of a sheet, but I think is is too laborious, as can be seen from the code below,…
sergio trajano
  • 189
  • 1
  • 1
  • 14
3
votes
0 answers

Recording is corrupted

I took an online VBA course back in June so I'm not sure if I turned something on/off but I can't record macros any more. If I record a simple format text macro (hit record, select the text, choose yellow background, red text, select stop macro),…
TB in DC
  • 31
  • 2
3
votes
1 answer

Why does Visual Basic Editor convert scientific notation to a number with # at the end?

I can't find any information on this: I am initializing a variable and when I enter a number in scientific notation such as 8.45673E11, but it converts it to its standard form with a compound sign at the end 845673000000# - I would like to know if…
GeekyFreaky
  • 283
  • 1
  • 2
  • 9
3
votes
3 answers

Application.Cells VS Application.ActiveSheet.Cells

The Macro Recorder generated the following statement: Cells.Select Now I understand that without the object qualifier this will return all the cells as a Range object. However, I am wondering what the fully qualified version of this statement…
GeekyFreaky
  • 283
  • 1
  • 2
  • 9
3
votes
2 answers

Spacebar not working at end of the line in Excel VBA Editor

I moved my personal.xlsb to my new laptop and I am having a strange issue. The spacebar is not working at the end of the line except it's a totally empty line. Example 1 : Not working example | Not working Example 2 : Working example | Would…
ikneT
  • 31
  • 1
  • 3
3
votes
1 answer

How can I rename a module using VBA macro?

I put one button on sheet. I want to assign macro for that button which change the module name. For e.g. There are two modules named Module1 and Module2. So I want to replace module name of above two modules with each other. Can anyone suggest me…
Jaydeep Bobade
  • 1,005
  • 2
  • 16
  • 25
3
votes
0 answers

How to navigate forward through the code?

In the VBE code window you can go to the last visited position in your code via CTRL+SHIFT+F2 There doesn't seem to be a way to go forward again so that you can navigate back and forth. Or is there? Code Window Navigation Keys
Roland
  • 7,525
  • 13
  • 61
  • 124
3
votes
1 answer

Import "ThisWorkbook" macro to another Workbook

I need VBA code to import a procedure into ThisWorkbook scope within another workbook. I have code to import a module into another workbook, but how to import this procedure into ThisWorkbook scope instead of into a module scope? Sub…
romanzdk
  • 930
  • 11
  • 30
3
votes
0 answers

VBE macro that creates shortcuts which include the autor of the linked file as property

this is my first question so I would love to improve my style and such. Just tell me if I am doing something completely wrong. My question: I am searching files with a specific extensions. All results get printed to excel and then create shortcuts…
Falkao
  • 33
  • 5
3
votes
1 answer

Rubberduck in Autocad

I see that v2.0: 75% there post mentions Autocad and there is an AutoCADApp.cs file, but I can't seem to find a reference for using Rubberduck outside of Office, under some random host application. There is this Adding a new Host Application to…
Nicu Tofan
  • 1,052
  • 14
  • 34
3
votes
0 answers

Event raised when closing or opening a CodePane

I'm writing a VBE/VBIDE add-in and I have a tool window that changes based on the open CodePane objects. Is there an event I can monitor when a code pane is added or removed from the CodePanes collection? The CodePanes collection itself appears…
mwolfe02
  • 23,787
  • 9
  • 91
  • 161
3
votes
1 answer

Commenting / Uncomment VBA code in Excel for Mac 2016

I've seen posts for how to comment / uncomment blocks of VBA code in Excel but they all seem to be related to Excel for Windows. I can't figure out a similar method for commenting large blocks of code in Excel for Mac 2016. Please help. Here is…