Skip to content
- Excel VBA: Find the Last Used Row in Any WorksheetTo find the last row containing content anywhere on a worksheet in Excel VBA, use Range.Find with SearchOrder:=xlByRows and SearchDirection:=xlPrevious. Searching for…VBA & macros
- Excel VBA: Find the Last Row with Data in a ColumnTo find the last populated row in column A with Excel VBA, use ws.Cells(ws.Rows.Count, "A").End(xlUp).Row, where ws is the worksheet you want…VBA & macros
- Excel VBA: Find the Last Row in a Column with DataIn Excel VBA, the usual way to find the last row with data in column A is ws.Cells(ws.Rows.Count, "A").End(xlUp).Row. Start at the…VBA & macros
- Excel VBA: Find the Last Column With Data in a RowTo find the last column containing data in a particular row, use ws.Cells(rowNumber, ws.Columns.Count).End(xlToLeft).Column. For the last column containing data anywhere on…VBA & macros
- Excel VBA: Find the Last Column in a Sheet or RangeTo find the last nonempty column in a specific row, start at the worksheet’s last column and move left with Excel VBA’s…VBA & macros
- Excel VBA: Find the Last Cell with Data in a ColumnIn Excel VBA, use Cells(Rows.Count, columnNumber).End(xlUp).Row to find the last nonblank cell’s row in a column. Check for an empty column first,…VBA & macros
- Excel VBA Find Method: Syntax, Examples, and TipsIn Excel VBA, use the Range.Find method to search a range and return the first matching cell; if there is no match,…VBA & macros
- Excel VBA: Find the First Non-Empty Row in a ColumnTo find the first non-empty row in an Excel column with VBA, use the range’s Find method with What:="*" and search from…VBA & macros
- Excel VBA Find the First Empty RowTo append data after the last entry in a known column, use Cells(Rows.Count, "A").End(xlUp).Row + 1, with a check for an entirely…VBA & macros
- Excel VBA: Find the First Empty Cell in a ColumnTo find the first empty cell in an Excel column with VBA, start at the first row you want to check and…VBA & macros
- Excel VBA Find Exact Match: Find Whole-Cell ValuesIn Excel VBA, set the LookAt argument of Range.Find to xlWhole to match an entire cell rather than a substring. For example,…VBA & macros
- Excel VBA: Find the Last Row of Data in a Column EasilyTo find the last populated row in column A with Excel VBA, use Cells(Rows.Count, "A").End(xlUp).Row, with the worksheet explicitly specified. If the…VBA & macros
- Excel VBA: Find a Date in a RangeIn Excel VBA, use the Range.Find method to locate an exact date in a range; set its search options explicitly because Excel…VBA & macros
- Excel VBA: Find a Column Number by Header Name in a RowTo find a column by its header in Excel VBA, search the header row with Range.Find and read the matching cell’s Column…VBA & macros
- Excel VBA: Find a Character Position in a String with InStrIn Excel VBA, use InStr to find where a character or text fragment first appears in a string: it returns a 1-based…VBA & macros
- Excel VBA Find Character in a String: InStr ExamplesIn Excel VBA, use the InStr function to find a character or a longer piece of text inside a string. It returns…VBA & macros
- Excel VBA: Find a Cell with Specific Text in a RangeTo find a cell containing specific text with Excel VBA, use the Range.Find method. Set options such as LookAt:=xlWhole for an exact…VBA & macros
- Excel VBA: Find a Cell Containing a Specific Date ValueTo find a cell containing a specific date with Excel VBA, loop through the date column and compare each cell’s numeric date…VBA & macros
- Excel VBA Find Cell: Code, Options, and ExamplesIn Excel VBA, use the Range.Find method to locate a cell containing specified text or a value. Set a worksheet and search…VBA & macros
- Excel VBA: Find the Bottom Row of Data in a SheetTo find the bottom row in a particular Excel column, start at the worksheet’s last row and move upward to the first…VBA & macros
- Excel VBA Find a Blank Cell: Methods and ExamplesTo find the first truly empty cell in a range with Excel VBA, loop through the cells and test IsEmpty(cell.Value). To find…VBA & macros
- Excel VBA Find and Replace in a Range: Code and TipsTo find and replace text only within a chosen Excel range, use VBA’s Range.Replace method and call it on that range—not on…VBA & macros
- Excel VBA Find and Replace Exact Text in a ColumnTo replace an exact cell value in one Excel column, use VBA’s Range.Replace method with LookAt:=xlWhole. For example, restricting the range to…VBA & macros
- Excel VBA Find and Replace: Methods and ExamplesTo find and replace text with Excel VBA, use the Range.Replace method and specify what to search for, what to insert, and…VBA & macros
- Excel VBA: Find All Cells With a ValueTo find every cell that matches a particular value in Excel VBA, use the Range.Find method and repeat the search with FindNext…VBA & macros
- Excel VBA Filter Range: AutoFilter Examples and FixesTo filter a range with Excel VBA, use the range’s AutoFilter method and specify the field number and criterion. For example, if…VBA & macros
- Excel VBA: Filter a PivotTable by Field or ValueYes. In Excel VBA, filter a PivotTable by setting a report-filter field’s CurrentPage, applying a label or value filter with PivotFilters.Add2, or…VBA & macros
- Excel VBA Filter Function: Syntax, Examples, and LimitsIn Excel VBA, the Filter function searches a one-dimensional array of strings and returns the elements that contain a specified piece of…VBA & macros
- Excel VBA File Path of an Open WorkbookIn Excel VBA, use ActiveWorkbook.Path to get the folder of the workbook currently active in Excel, or ThisWorkbook.Path to get the folder…VBA & macros
- Excel VBA Error Handler: How to Catch and Fix ErrorsAn Excel VBA error handler is code that tells a macro what to do when a runtime error occurs. In most procedures,…VBA & macros