Skip to content
- Hide Column VBA: Methods, Examples, and TroubleshootingTo hide a column with VBA in Excel, set that column’s Hidden property to True, such as Worksheets("Data").Columns("C").Hidden = True. Set it…VBA & macros
- VBA GoTo: Syntax, Examples, and Safer AlternativesIn VBA, GoTo is a statement, not a function: it transfers execution to a labeled line in the same procedure. It is…VBA & macros
- Goal Seek VBA: Automate Excel What-If AnalysisIn Excel VBA, use the GoalSeek method on a formula cell to make it reach a target by changing one input cell.…VBA & macros
- Get Workbook Path in VBA: FullName vs PathTo get a workbook’s folder in VBA, read its Path property; to get the complete location including the file name, read FullName.…VBA & macros
- VBA Function Syntax: How to Write and Call FunctionsIn VBA, a function starts with a Function declaration, contains statements that calculate a result, and ends with End Function. Assign the…VBA & macros
- VBA Functions: Basics, Examples, and How to Write ThemA VBA function is a named block of code that performs a task and returns a value. In Excel for Microsoft 365…VBA & macros
- Excel VBA Range.Formula: How to Read and Set FormulasIn Excel VBA, use a range’s Formula property to read or write a worksheet formula in A1 notation. For example, with a…VBA & macros
- Formula VBA Loop: How Excel Formulas and Loops DifferIn Excel, use a worksheet formula when you want a result that updates as cell values change; use a VBA loop when…VBA & macros
- Named Ranges in Excel VBA: When Do Names Need Quotes?Usually, yes: when you write a named range directly inside a VBA reference such as Range("TaxRate"), put its name in straight double…VBA & macros
- Pivot Table VBA: How to Hide SubtotalsTo hide subtotals in an Excel PivotTable with VBA, set the Subtotals property to twelve false values for each row or column…VBA & macros
- Display MsgBox in VBA: Syntax, Buttons, and ExamplesTo display a message box in VBA, call MsgBox, for example MsgBox "Update complete", vbInformation, "Status". If your macro needs to act…VBA & macros
- Dim ws As Worksheet in VBA: Meaning and UseDim ws As Worksheet declares a variable named ws that can refer to an Excel worksheet, but it does not select or…VBA & macros
- Excel UserForm Controls: A Practical Guide to Types and UseExcel UserForm controls are the buttons, text boxes, lists, and other interface elements you add to a VBA form so people can…VBA & macros
- Dim Worksheet VBA: Declare and Set a Sheet VariableIn Excel VBA, use Dim ws As Worksheet to declare a variable that can refer to a worksheet; then use Set ws…VBA & macros
- Dim VBA String: How to Declare and Use Text VariablesIn VBA, declare a text variable with Dim variableName As String, such as Dim customerName As String. The Dim statement declares the…VBA & macros
- Excel UserForm ComboBox: Setup, Code, and Common IssuesAn Excel UserForm ComboBox is a VBA form control that lets someone choose an item from a drop-down list, and, depending on…VBA & macros
- Excel UserForm Coding: Build a VBA Data-Entry FormExcel UserForm coding means using VBA to build a custom window for entering, reviewing, or selecting information in a workbook. In Excel…VBA & macros
- Excel Macro to Clear Specific Cells: Safe VBA GuideTo clear chosen cells in Excel with a macro, use VBA’s ClearContents method on a worksheet range. For example, Worksheets("Input").Range("B2,D5,F10:F12").ClearContents removes the…VBA & macros
- Excel Macro to Hide Columns: VBA Examples and TipsTo hide columns with a VBA macro in Excel for Microsoft 365 on Windows, put Columns("B:D").Hidden = True in a procedure and…VBA & macros
- Excel Macro Type Mismatch: Causes and FixesAn Excel macro “Type mismatch” is VBA run-time error 13: code tried to use a value as a different data type than…VBA & macros
- VBA Dictionary: How It Works, Examples, and Common UsesA VBA Dictionary is a key–value collection: you store a value under a unique key, then retrieve it quickly by that key.…VBA & macros
- Excel UserForm Checkbox: Add, Code, and TroubleshootAn Excel UserForm checkbox is a clickable VBA control that lets someone choose a yes-or-no option in a custom form. In Microsoft…VBA & macros
- VBA Functions: What They Are and How to Use ThemA function in VBA is a named procedure that performs a task and returns a value. You can call one from another…VBA & macros
- VBA Date Variables: How to Declare and Use ThemIn VBA, declare a date variable with Dim eventDate As Date. A Date variable can hold a calendar date, a time, or…VBA & macros
- Date Picker in VBA UserForms: Setup and AlternativesExcel for Microsoft 365 on Windows does not provide a built-in date picker control for VBA UserForms. To let users select dates…VBA & macros
- Create a Dictionary in VBA: Keys, Values, and Code ExamplesTo create a dictionary in VBA for Excel on Windows, declare an object and use CreateObject("Scripting.Dictionary"). Add entries as key–value pairs, then…VBA & macros
- Conditional Formatting VBA: Rules, Examples, and TipsIn Excel for Microsoft 365 on Windows, VBA creates conditional formatting by adding a rule to a range’s FormatConditions collection. For example,…VBA & macros
- Excel Macro Settings Greyed Out? Causes and How to FixIf Excel macro settings are greyed out, they are usually being controlled by an administrator or you are using Excel for the…VBA & macros
- Combobox in VBA UserForms: Setup, Code, and TipsA ComboBox in a VBA UserForm lets a person choose an item from a drop-down list, and it can also allow typed…VBA & macros
- Excel Macro Security Settings: What to Choose and WhyIn Excel for Microsoft 365 on Windows, go to File > Options > Trust Center > Trust Center Settings > Macro Settings…VBA & macros