Skip to content
- Excel Function to Extract Part of a String: ExamplesExcel has several functions for extracting part of a string: use LEFT for characters at the start, RIGHT for characters at the…Formulas & functions
- VBA MsgBox Cancel: How to Exit a Sub SafelyTo stop a VBA Sub when someone clicks Cancel, use a MsgBox that includes the Cancel button, check whether its return value…VBA & macros
- VBA MsgBox Cancel: Buttons, Return Values, and CodeTo detect Cancel in VBA, show a MsgBox button set that includes Cancel, store the function’s result, and compare it with vbCancel.…VBA & macros
- Excel ABS Function: How to Return a Positive ValueTo turn a negative number into a positive one in Excel, use the ABS function: it returns the number’s absolute value. For…Formulas & functions
- Excel Function to Remove Text from a StringExcel does not have one universal “remove text” function: use SUBSTITUTE to remove specified characters or words, REPLACE to remove text at…Formulas & functions
- VBA MsgBox Buttons: Options, Examples, and Return ValuesIn VBA, the MsgBox function’s buttons argument controls which buttons and icon appear, which button is selected by default, and sometimes how…VBA & macros
- Excel Function Not Showing Result? Fix the FormulaIf an Excel function is not showing a result, first check whether Excel is displaying formulas, treating the entry as text, or…Errors & fixes
- VBA MsgBox Bold Text: Limits and Better AlternativesNo: VBA’s built-in MsgBox cannot make selected words bold or apply rich-text formatting. If you need bold text, use a VBA UserForm…VBA & macros
- Excel Functions to Extract Text From Strings: A GuideExcel has several functions for extracting text from a string. Use LEFT, RIGHT, or MID to return characters by position; in Microsoft…Formulas & functions
- VBA MsgBox Auto Close: Options and LimitationsA standard VBA MsgBox cannot be set to close itself after a number of seconds: its arguments include no timeout option. On…VBA & macros
- Excel Function to Check If a Cell Contains TextTo check whether a cell contains a particular word or phrase, use =ISNUMBER(SEARCH("text",A2)), replacing “text” with the text you want to find.…Formulas & functions
- VBA MsgBox Arguments: Buttons, Icons, and ExamplesIn VBA, MsgBox displays a dialog and can return the button the user clicked. Its arguments are Prompt, optional Buttons, optional Title,…VBA & macros
- VBA Modify Pivot Tables in Excel: Examples and TipsYes. VBA can modify an Excel PivotTable by moving fields between rows, columns, filters, and values; setting report filters; changing some layout…VBA & macros
- VBA Method to Sort Data in ExcelThe VBA method to sort data in Excel is the Sort object, configured with a sort key, a range, and a header…VBA & macros
- VBA Make String Uppercase with UCase: Examples and TipsTo make a string uppercase in VBA, use the built-in UCase function: assign UCase("hello") to a variable and it returns HELLO. For…VBA & macros
- VBA Macro to Create a Pivot Table in ExcelTo create a PivotTable with VBA, select a worksheet containing a header row and data, then run a macro that builds a…VBA & macros
- VBA Macro Recorder: Record, Edit, and Run MacrosThe VBA Macro Recorder in desktop Excel turns a sequence of actions into Visual Basic for Applications (VBA) code that you can…VBA & macros
- VBA MsgBox: How to Display Messages in ExcelIn Excel VBA, MsgBox displays a dialog box containing a message and optional buttons, and it can return the button the user…VBA & macros
- VBA Loop Through Dictionary Items: Keys, Values, and TipsTo loop through a VBA dictionary’s entries, use For Each on its keys, then retrieve each associated value with dict(key). To loop…VBA & macros
- VBA Loop Through Dictionary Keys: Examples and TipsTo loop through the keys in a VBA Scripting.Dictionary, use For Each with a Variant control variable: For Each key In dict.Keys.…VBA & macros
- VBA Len String Variable: Count Characters CorrectlyIn VBA, use Len(stringVariable) to get the number of characters in a string; the result is a Long. For example, if customerName…VBA & macros
- VBA Left Function: How to Return Text from the StartIn VBA, use Left(string, length) to return a specified number of characters from the beginning of a string. For example, Left("AB-8421", 2)…VBA & macros
- VBA Jump to Next Loop: How to Skip an IterationVBA has no built-in Continue For or Continue Do statement. To jump to the next loop iteration, put the remaining work inside…VBA & macros
- VBA Insert Pivot Table in Excel: Practical Code GuideTo insert a PivotTable with VBA in Excel for Microsoft 365 on Windows, create a PivotCache from your source range, create a…VBA & macros
- VBA InputBox Yes/No Questions: Use MsgBox CorrectlyVBA’s standard InputBox cannot display Yes and No buttons; it collects text instead. To ask a true yes-or-no question in Excel VBA,…VBA & macros
- VBA InputBox Prompt: Syntax, Examples, and Common FixesIn VBA, use the InputBox function to display a prompt and collect text from a user: assign its result to a variable,…VBA & macros
- VBA InputBox Password: How to Hide Typed TextInputBox in VBA has no password or masking option: it displays whatever the user types. In Excel for Microsoft 365 on Windows,…VBA & macros
- VBA InputBox Options: Types, Syntax, and ExamplesExcel VBA offers two main input-box choices: the built-in InputBox function for a simple text response, and Application.InputBox when you need to…VBA & macros
- VBA InputBox: What OK and Cancel ReturnIn VBA, the standard InputBox function returns an empty string when the user clicks either OK with no text or Cancel, so…VBA & macros
- Excel Formula for Removing Spaces: TRIM and MoreIn Excel, use =TRIM(A2) to remove leading and trailing spaces and reduce repeated spaces between words to one. If you want to…Formulas & functions