Skip to content
- Excel VBA CountIfs Multiple Criteria: How to UseIn Excel VBA, you can count cells that meet multiple criteria by using the WorksheetFunction.CountIfs method, which mirrors the worksheet function COUNTIFS.…VBA & macros
- Excel VBA Conditional Formatting Formula GuideThe core formula for Excel VBA conditional formatting is Range.FormatConditions.Add combined with a formula string, for example Range("A1:A10").FormatConditions.Add Type:=xlExpression, Formula1:="=A1>100". This applies…VBA & macros
- Excel VBA Concatenate: How to Join Strings in MacrosThe direct answer: in Excel VBA, you concatenate strings with the ampersand operator (&), for example Range("A1") = "Hello " & "World".…VBA & macros
- Excel VBA to Protect and Unprotect Sheet: Full CodeThe fastest way to protect or unprotect a sheet in Excel VBA is Worksheets("Sheet1").Protect and Worksheets("Sheet1").Unprotect. For a password, add Password:="YourPassword" inside…VBA & macros
- Excel VBA Code to Hide and Unhide SheetsThe quickest VBA code to hide a sheet is Sheets("Sheet1").Visible = xlSheetHidden, and to unhide it use Sheets("Sheet1").Visible = xlSheetVisible. For a…VBA & macros
- Excel VBA Code to Format Cells: A Practical GuideThe fastest way to format cells with Excel VBA is to use the .Font, .Interior, and .Borders properties of a Range object,…VBA & macros
- Excel VBA Clear Row Contents: 4 WaysTo clear row contents in Excel VBA, use the Range.ClearContents method on the entire row, for example Rows(5).ClearContents clears row 5. For…VBA & macros
- Excel VBA Clear Formatting and Contents: Full GuideThe fastest way to clear both formatting and contents in Excel VBA is to use the Clear method on a range, for…VBA & macros
- Excel VBA Clear Contents Merged Cell: How ToTo clear only the contents of a merged cell in Excel VBA without unmerging it, use Range("A1").ClearContents — this works on merged…VBA & macros
- Excel VBA: Clear Contents of Multiple RangesTo clear the contents of multiple ranges in Excel VBA, use the Range.ClearContents method on each range, or combine them into a…VBA & macros
- Excel VBA: Clear Entire Column ContentsTo clear the contents of an entire column in Excel VBA, use the ClearContents method on the column’s Range object, for example:…VBA & macros
- Excel VBA: Clean CSV Data Before ImportingYes, you can and should use Excel VBA to clean CSV data before importing it into a worksheet, because it lets you…VBA & macros
- Excel VBA Clean: How to Remove and Fix CodeYes, Excel VBA can be cleaned, and “clean” usually means one of two things: removing VBA code entirely from a workbook, or…VBA & macros
- Excel VBA Cell Border: How to Add, Remove, and FormatTo add a border to a cell in Excel VBA, use the BorderAround method or set the Borders collection properties. For example,…VBA & macros
- Excel VBA Capitalize String: UCase, StrConv, and MoreTo capitalize a string in Excel VBA, use the UCase function to convert all letters to uppercase (e.g., UCase("hello") returns “HELLO”), or…VBA & macros
- Excel VBA Cannot Run the Macro? Fixes That WorkIf Excel says it cannot run the macro, the cause is almost always a security setting, a disabled workbook, or a code…VBA & macros
- Excel VBA Border Weights: XlBorderWeight Enum GuideIn Excel VBA, border weights are controlled by the XlBorderWeight enumeration, which offers four values: xlHairline (1), xlThin (2), xlMedium (-4138), and…VBA & macros
- Excel VBA Block Statement: Syntax & UsageIn Excel VBA, a “block statement” refers to a group of code lines that are executed together as a single logical unit,…VBA & macros
- Excel VBA Autofit Column Width: How to Do ItTo autofit a column’s width in Excel VBA, use the AutoFit method on the EntireColumn property of a range, for example Range("A:A").EntireColumn.AutoFit.…VBA & macros
- Excel VBA Autofill to Last Row: Step-by-StepThe quickest way to autofill a formula down to the last row of data in Excel VBA is to use the Range.AutoFill…VBA & macros
- Excel VBA: Assign Macro to Form Control ButtonTo assign a macro to a form control button in Excel, right-click the button, select Assign Macro, choose the macro from the…VBA & macros
- Excel VBA: Add Sheet and Name It (Step-by-Step)To add a new worksheet and name it with Excel VBA, use Sheets.Add followed by setting the Name property, for example: Sheets.Add.Name…VBA & macros
- Excel VBA: Add a Button to a SheetTo add a button to an Excel sheet using VBA, you can either insert a Form Control or ActiveX button manually and…VBA & macros
- Excel Strikethrough: How to Add It & ShortcutsTo strikethrough text in Excel, select the cell(s) and press Ctrl+5 on Windows (or Cmd+Shift+X on Mac). You can also use the…How-to basics
- Excel Strikethrough: How to Apply & Remove ItYes, Excel values can have strikethrough formatting. You can apply it manually with a keyboard shortcut, through the Format Cells dialog, or…How-to basics
- Excel Utility for E-Invoice: What It DoesExcel can serve as a practical utility for e-invoicing when you use it to generate, validate, and manage invoice data in a…How-to basics
- Excel Use Formula in Table Header? (Yes, Here’s How)Yes, you can use a formula in an Excel table header, but with a strict rule: the header row itself cannot contain…Formulas & functions
- Excel UNIQUE Function Returns Duplicates? Fix ItNo, the Excel UNIQUE function does not return duplicates—it is specifically designed to extract unique values from a range or array. If…Errors & fixes
- Excel Unique Exclude Duplicates: 5 WaysTo exclude duplicates and list only unique values in Excel, use the UNIQUE function: =UNIQUE(range). For example, =UNIQUE(A2:A20) returns each distinct item…Formulas & functions
- Excel Trying to Refresh Pivot Table? Fix It NowIf Excel is trying to refresh a pivot table and nothing happens, or it shows an error, the fix is usually to…Charts & pivot tables