Skip to content
- Excel Formula to Join Two Text CellsTo join two text cells in Excel, enter =A2&B2 in another cell, replacing A2 and B2 with the cells you want to…Formulas & functions
- VBA Destination Range: How to Set It in Excel MacrosA VBA destination range is the cell or group of cells where a macro puts, copies, or otherwise writes data. In practice,…VBA & macros
- Excel Formula for Checking If a Date Is Before Another DateTo check whether one date is earlier than another in Excel, use the less-than operator: with the date to test in A2…Formulas & functions
- VBA UserForm Design: Build a Practical Excel FormTo design a VBA UserForm in Excel, open the Visual Basic Editor, choose Insert > UserForm, add controls from the Toolbox, and…VBA & macros
- Excel Formula If Cell Contains Value: Practical ExamplesTo return one result when a cell is not empty and another when it is empty, use =IF(A2<>"","Yes","No"). With the value to…Formulas & functions
- VBA Convert String to Uppercase with UCase ExamplesUse VBA’s UCase function to convert a string to uppercase; for a result explicitly typed as a String, use UCase$. For example,…VBA & macros
- Excel Formula to Highlight a Row If a Cell ContainsWith the search term in E2, the value to check in column A, and rows 2–100 to format across A:D, use =AND($E$2<>"",ISNUMBER(SEARCH($E$2,$A2)))…Formulas & functions
- VBA Convert String to Integer: CInt, CLng, and ErrorsIn VBA, convert a numeric string with CInt for a 16-bit Integer or CLng for a 32-bit Long: for example, result =…VBA & macros
- Excel Formula to Highlight Every Other Row AutomaticallyTo highlight every other row in Excel, select the range, open Home > Conditional Formatting > New Rule, choose “Use a formula…Formulas & functions
- VBA Convert String to Date: Safe Parsing in Excel MacrosIn VBA, use CDate to convert a string that VBA recognizes as a date, or DateValue when you want only the date…VBA & macros
- Excel Formula for Highest Value: MAX and Other OptionsTo find the highest value in Excel, use the =MAX(B2:B20) formula, assuming the numbers you want to compare are in cells B2…Formulas & functions
- VBA Coding Dictionary: How the Dictionary Object WorksA VBA Dictionary is an object that stores pairs of keys and values, letting an Excel macro look up a value by…VBA & macros
- Excel Formula Greyed Out? Causes and FixesIf Excel’s formula commands are greyed out, first press Esc to leave cell-edit mode, then select a worksheet cell and check whether…Formulas & functions
- VBA While Loop: Syntax, Examples, and Safe UseA VBA While loop repeats a block of code as long as a condition is true. In Excel, you can write it…VBA & macros
- Excel Greater Than or Equal To: Formula and ExamplesIn Excel, the greater-than-or-equal-to operator is >=. Put it between two values in a formula, such as =A1>=B1, and Excel returns TRUE…Formulas & functions
- VBA Code to Update a PivotTable in Excel AutomaticallyTo update one PivotTable in Excel for Microsoft 365 on Windows, call its RefreshTable method from a VBA macro. For example, assign…VBA & macros
- Excel Greater Than and Less Than Formulas ExplainedIn Excel, use > to test whether a value is greater than another and < to test whether it is less. If…Formulas & functions
- VBA Code to Sort Data by Multiple ColumnsTo sort Excel rows by multiple columns with VBA, use the worksheet’s Sort object, add one sort field for each key in…VBA & macros
- Excel Formula for the Greater of Two CellsTo return the larger of two cell values in Microsoft Excel, use =MAX(A2,B2). This example assumes the two values are in A2…Formulas & functions
- VBA Code to Sort Excel Data by One or More ColumnsTo sort Excel rows with VBA, define the complete data range, add one or more sort keys, set the header option, and…VBA & macros
- VBA Code to Send an Email With an AttachmentTo send an email with an attachment from Excel VBA on Windows, create an Outlook mail item, add the file with .Attachments.Add,…VBA & macros
- Excel Formula for the Tab Name: Get the Worksheet NameYes. In Excel for Microsoft 365 on Windows, enter =MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255) in a cell on the worksheet whose name you want; it returns…Formulas & functions
- VBA Code to Refresh Pivot Tables Automatically in ExcelTo refresh every PivotTable in the workbook that contains your VBA, run a macro that loops through each worksheet and calls RefreshTable.…VBA & macros
- Excel EOMONTH Formula: Find the Last Day of a MonthUse Excel’s EOMONTH function to return the last day of a month: enter =EOMONTH(start_date, months), replacing the arguments with a date and…Formulas & functions
- VBA Code to Display a Graph on a UserFormUse an Excel chart on a worksheet as the graph source, export it as a JPEG, then load that image into an…VBA & macros
- Excel Formula: Add Days to a DateIf A2 contains a real Excel date, add a number of days in B2 with =A2+B2; for a fixed number, use =A2+10.…Formulas & functions
- VBA Code to Sort Data in Excel: Examples and TipsTo sort Excel data with VBA, define the complete data range, add the column or columns to sort by, set the sort…VBA & macros
- Excel Date Format Formulas: TEXT, DATEVALUE, and MoreTo display a date as text with an Excel formula, use TEXT; with a date in A2, =TEXT(A2,"mmmm d, yyyy") returns a…Formulas & functions
- VBA Code to Save a Workbook in Excel: Practical ExamplesTo save the workbook that contains your VBA code, use ThisWorkbook.Save; to save the active workbook, use ActiveWorkbook.Save. To save a workbook…VBA & macros
- Excel Formula to Combine Text From Two Cells with a SpaceWith text in A1 and B1, join the contents directly with =A1&B1; to put a space between them, use =A1&" "&B1. Enter…Formulas & functions