Skip to content
- Excel VBA Arrays: How to Define and Use ThemAn Excel VBA array is a variable that holds multiple values under one name, with each value accessed by an index. Declare…VBA & macros
- Excel VBA Array Count: Find the Number of ElementsIn Excel VBA, count the elements in an array with UBound(array) - LBound(array) + 1 for a one-dimensional array. Because arrays do…VBA & macros
- Excel VBA Arrays: What They Contain and How to Use ThemAn Excel VBA array contains an ordered set of elements that a macro can access by index; those elements can hold values…VBA & macros
- Excel VBA Array Clear: How to Erase or Reset ValuesTo clear a VBA array, use the Erase statement: Erase arrayName. For a fixed-size array, this resets its elements to their default…VBA & macros
- Excel VBA Array Append: Safe Methods and ExamplesTo append a value to a one-dimensional Excel VBA array, increase its upper bound with ReDim Preserve, then assign the new value…VBA & macros
- Excel VBA Array: How to Add an ItemTo add an item to a one-dimensional dynamic VBA array, increase its upper bound with ReDim Preserve, then assign the new value…VBA & macros
- Excel VBA AutoFilter: How to Apply Filters with CodeIn Excel VBA, apply AutoFilter to a range that includes its header row, then set the field number and criterion—for example, filter…VBA & macros
- Excel VBA Array Add: Append Values with ReDim PreserveTo add an item to a VBA array, resize a dynamic array with ReDim Preserve, then assign the new value to its…VBA & macros
- Excel VBA Application.InputBox Type: Values and UseIn Excel VBA, the Type argument of Application.InputBox controls what kind of response the dialog accepts and returns. For example, use Type:=1…VBA & macros
- Excel VBA: Append a Worksheet to Another Workbook SafelyTo append a worksheet with Excel VBA, copy it after the destination workbook’s last sheet. The macro below copies the Data sheet…VBA & macros
- Excel VBA Array Allocation: Declare, Size, and ResizeIn Excel VBA, declare a dynamic array with empty parentheses, then allocate it with ReDim; for example, use Dim values() As Long…VBA & macros
- Excel VBA: Add a Worksheet With a Specific Name SafelyTo add a worksheet with a specific name in Excel VBA, add the sheet to the intended workbook and then assign its…VBA & macros
- Excel VBA Dictionary: Add Items and Handle Existing KeysIn Excel VBA, add a key-item pair to a dictionary with its .Add method, such as dict.Add "North", 125. A dictionary has…VBA & macros
- Excel VBA: Add Double Quotes to a String in VBA CodeTo add double quotes around a string in Excel VBA, concatenate a quote character before and after the text: Chr(34) & text…VBA & macros
- Excel VBA: Add Days to a Date in Excel Cells and MacrosTo add days to a date in Excel VBA, use DateAdd("d", numberOfDays, dateValue) or add a whole number directly to a date…VBA & macros
- Excel VBA: Add a Date to a Cell, Once or AutomaticallyTo add today’s date to a cell with Excel VBA, assign the VBA Date value to that cell, then set its display…VBA & macros
- Excel VBA Add AutoFilter: Code, Examples, and FixesTo add AutoFilter with Excel VBA, identify the header-and-data range and call its AutoFilter method: dataRange.AutoFilter. For example, a macro can use…VBA & macros
- Excel VBA Absolute Value: How to Use AbsIn Excel VBA, use the built-in Abs function to return a number’s absolute value: Abs(number). For example, Abs(-12.5) returns 12.5; the function…VBA & macros
- Excel VBA ABS Function: Syntax and ExamplesIn Excel VBA, use the built-in Abs function to return a number’s absolute value: Abs(number). For example, Abs(-12.5) returns 12.5, while Abs(12.5)…VBA & macros
- Excel Trendline Formula: How to Show and Use It in ChartsTo show a trendline formula in an Excel chart, select the chart, choose Chart Design > Add Chart Element > Trendline >…Charts & pivot tables
- Excel Trendline Equation in a Cell: How to Calculate ItYes. For a linear trendline, calculate its slope and intercept in worksheet cells, then use those values to predict results; Excel does…Charts & pivot tables
- Excel Slicers for Multiple PivotTables: How to ConnectYes. In Excel for Microsoft 365 on Windows, one slicer can filter multiple PivotTables when they share a compatible data source or…How-to basics
- Excel Named Ranges in Formulas: How to Use ThemYes. In Excel for Microsoft 365, type a defined name into a formula anywhere you would otherwise use its cell reference or…Formulas & functions
- Excel Named Ranges in Data Validation: How to Use ThemYes. In Excel for Microsoft 365 on Windows, create a named range for the cells that contain your choices, then set the…How-to basics
- Excel Text to Columns: How to Undo and Restore DataTo undo Text to Columns in Excel for Microsoft 365 on Windows, press Ctrl+Z immediately after running it; on a Mac, press…How-to basics
- Excel Unable to Remove Duplicates? Common Causes and FixesIf Excel cannot remove duplicates, select a cell in the complete data range, choose Data > Remove Duplicates, confirm the columns that…How-to basics
- Excel Unable to Merge Cells? Causes, Fixes, and AlternativesIf Excel is unable to merge cells, first check that you selected one continuous range, the cells are not inside an Excel…How-to basics
- Excel Pasting: Stop Tab-Delimited Text Splitting on PasteExcel has no global switch that turns off column splitting when you paste tab-delimited text. For a small amount of text, edit…How-to basics
- Excel Trendline Values: Show, Calculate, and Use ThemIn Excel, trendline values are the estimated y-values produced by a trendline for particular x-values. To see a trendline equation on a…Charts & pivot tables
- Excel Trendline Slope Formula: Find and Interpret ItIf your x-values are in A2:A6 and your y-values are in B2:B6, calculate the linear trendline slope in Excel with =SLOPE(B2:B6,A2:A6). The…Charts & pivot tables