VBA & macros
Automate repeat work with macros and VBA code.
- Excel Macro Recorder Key: Start, Stop and Assign ShortcutsIn Excel for Microsoft 365 on Windows, there is no default keyboard shortcut that starts the macro recorder. To record, choose Developer…
- VBA Function vs Sub: Differences and When to Use EachA VBA Function calculates and returns a value; a Sub carries out actions and does not return a value. Use a Function…
- Excel VBA Unprotect Sheet: Safe Methods and ExamplesTo unprotect a worksheet with VBA in Excel for Microsoft 365 on Windows, use Worksheet.Unprotect and supply the sheet’s password if it…
- Macro Recorder Hacks: What Works and What Doesn’tMacro recorder hacks are best understood as practical ways to make repetitive computer tasks easier—not secret commands that unlock a computer or…
- VBA Function Structure: Syntax, Examples, and ScopeA VBA function is a procedure that performs work and returns a value. Its basic structure is Function Name(arguments) As ReturnType, followed…
- Excel VBA Unique Values: Code, Methods, and Practical TipsTo return unique values with Excel VBA, read the source cells, keep each value only the first time it appears, and write…
- Macro Recorder GitHub: How to Find the Right ProjectYes—GitHub has macro-recording projects, but the right choice depends on your operating system and what you want to automate. A useful Windows…
- Excel VBA Union: Combining Multiple Ranges in a Single MacroIn Excel VBA, Union combines two or more ranges on the same worksheet into one Range object, even when the cells are…
- Macro Recorder for Mac OS X: Best Options and SetupFor a macro recorder on Mac OS X, use Automator’s “Watch Me Do” recording feature if your version includes it, or choose…
- Excel VBA Unhide Sheet: Methods and Common FixesTo unhide a worksheet with VBA, set its Visible property to xlSheetVisible, such as Worksheets("Summary").Visible = xlSheetVisible. For a normal hidden sheet,…
- VBA Function Statement: Syntax, Scope, and ExamplesThe VBA Function statement declares a procedure that performs a task and returns a value. You can call a function from other…
- Macro Recorder for Mac: Options and How to ChooseYes—Mac users can record and replay repetitive actions, but macOS does not provide one universal recorder that captures every action in every…
- Excel VBA Type Mismatch: Causes and FixesIn Excel VBA, “Run-time error 13: Type mismatch” means VBA tried to use a value as a different data type than the…
- VBA Set Statement: How to Assign Object ReferencesIn VBA, Set is a statement—not a function—that assigns an object reference to an object variable. Use it for objects such as…
- Macro Recorder for Automation: What It Can and Can’t DoYes. Excel for Microsoft 365 on Windows includes a macro recorder that turns many repeated actions into VBA code you can run…
- Excel VBA Timer: Measure Code and Schedule Macros SafelyIn Excel VBA, use the Timer function to measure elapsed time, and use Application.OnTime to schedule a macro to run later. They…
- VBA Function Return Multiple Values: What WorksYes. A VBA function can provide multiple results, but it has only one formal return value. To deliver several pieces of data,…
- Visual Basic: Add a Comment to an Excel Cell with VBAYes. In Excel for Microsoft 365 on Windows, use VBA’s Range.AddComment method to add a note to a cell; Excel still uses…
- Macro Recorder Extension: Excel File Types ExplainedExcel does not need a separate macro recorder extension: Microsoft Excel for Microsoft 365 has a built-in recorder on the Developer tab.…
- VBA Function Return Values: How to Return a ResultIn VBA, a function returns a value by assigning that value to the function’s own name; VBA does not use a separate…
- Excel VBA TextBox: Add, Configure, and Use It in FormsAn Excel VBA TextBox is a text-entry control that lets a workbook user type information, such as a name or search term,…
- Excel Macro Recorder: Enterprise Safety, Uses, and LimitsExcel’s built-in Macro Recorder is available in desktop Excel for Microsoft 365, but it is not a separate enterprise automation platform or…
- Excel VBA Text Function: Format Values and CellsIn Excel VBA, use the Format function—usually Format$—to turn a number or date into a formatted string; Excel’s worksheet TEXT function is…
- VBA Optional Parameters: Syntax and ExamplesYes. In VBA, add the Optional keyword to a procedure parameter and, for most typed parameters, provide a default value; callers can…
- Macro Recorder Compatibility Across Excel VersionsExcel’s macro recorder creates VBA macros that work in desktop Excel for Windows and Mac, but compatibility is not guaranteed between platforms…
- VBA Function Calls: Syntax, Examples, and Common ErrorsA VBA function call runs a function and, in the usual case, uses the value it returns. In Excel, you can call…
- Excel VBA Switch Case: Select Case Syntax and ExamplesExcel VBA does not have a switch-case statement named Switch; its equivalent is Select Case. Use it to run one block of…
- Excel Macro Recorder Commands and How to Use ThemIn Excel for Microsoft 365 on Windows, the main macro recorder commands are Developer > Code > Record Macro and Developer >…
- VBA Function As Boolean: How to Return True or FalseYes. In VBA, declare a function with As Boolean when it should return either True or False, then assign the result to…
- Excel VBA Substring: Extract, Find, and Replace TextExcel VBA has no built-in function named Substring, but you can work with part of a string using Left$, Right$, and Mid$.…