Top "Vba" questions

Visual Basic for Applications (VBA) is an event-driven, object-oriented programming language for writing macros, used for the entire Office suite as well as other applications.

Is it possible to declare a public variable in vba and assign a default value?

I want to do this but it won't compile: Public MyVariable as Integer = 123 What's the best way of achieving this?

vba variables default-value public variable-declaration
Get User Selected Range

How can I get a range of cells selected via user mouse input for further processing using VBA?

vba excel excel-2003
VBA code to show Message Box popup if the formula in the target cell exceeds a certain value

I am trying to write a simple macro to display a pop-up (vbOKOnly) if the value in a cell exceeds …

vba excel messagebox
Create a folder and sub folder in Excel VBA

I have a pull down menu of companies that is populated by a list on another sheet. Three columns, Company, …

excel vba macos directory create-directory
Creating an Array from a Range in VBA

I'm having a seemingly basic problem but can't find any resources addressing it. Simply put, I just want to load …

arrays excel vba range
Run Excel Macro from Outside Excel Using VBScript From Command Line

I'm trying to run an Excel macro from outside of the Excel file. I'm currently using a ".vbs" file run …

excel vba command-line vbscript
Call a Subroutine from a different Module in VBA

Is it possible to call a function from one Module to another? I have the following code: Sub MAIN() Call …

vba module call
What is the difference between "Form Controls" and "ActiveX Control" in Excel 2010?

Using Microsoft Excel 2010, I noticed two kind of controls that can be inserted into a document: Form Controls and ActiveX …

excel vba excel-2010 activex form-control
How to add a custom Ribbon tab using VBA?

I am looking for a way to add a custom tab in the Excel ribbon which would carry a few …

excel vba excel-2007 ribbonx
How to add a reference programmatically

I've written a program that runs and messages Skype with information when if finishes. I need to add a reference …

excel vba reference