VBA & macros
Automate repeat work with macros and VBA code.
- VBA Find Position of a Character in a String with InStrUse VBA’s InStr function to find a character in a string: it returns the character’s 1-based position, or 0 if the character…
- VBA Find Position of a Substring in a StringIn VBA, use InStr to find a substring’s position within a string: it returns the position of the first match, or 0…
- VBA Find Row: Search a Column and Return the MatchTo find a row in VBA, use Excel’s Range.Find method on the column or range you want to search, then read the…
- VBA Find Method in Excel: Syntax and ExamplesIn Excel VBA, the Range.Find method searches a specified range and returns the first matching cell as a Range object; if nothing…
- VBA Find: Search Excel Ranges and Handle Results SafelyIn Excel VBA, Find is a method of a Range, not a separate object: it searches a specified range and returns a…
- VBA Find the Next Empty Row in Excel AutomaticallyTo find the next row for appending data in VBA, use Cells(Rows.Count, "A").End(xlUp).Row + 1, replacing column A with a column that…
- VBA Find Match: Search Excel Cells and Return ResultsIn Excel VBA, use the Range.Find method to search a range and return the first matching cell. For an exact whole-cell match,…
- VBA Find the Maximum Value in an Excel Column: How-ToTo find the largest numeric value in an Excel column with VBA, use the worksheet function Max on the range you want…
- VBA Find Last Used Column in Excel: Reliable MethodsTo find the last used column anywhere on an Excel worksheet with VBA, use Range.Find with SearchOrder:=xlByColumns and SearchDirection:=xlPrevious. The example below…
- VBA Find Last Row: Reliable Methods and ExamplesIn VBA, find the last row in a particular column with ws.Cells(ws.Rows.Count, "A").End(xlUp).Row. To find the last row containing content anywhere on…
- VBA Find the Last Row With Data in an Excel WorksheetTo find the last row in a known column, start at the bottom of that column and use End(xlUp): ws.Cells(ws.Rows.Count, "A").End(xlUp).Row. If…
- VBA Find the Last Used Cell When Filters Are OnTo find the last used cell in Excel VBA while a filter is active, search the worksheet with Range.Find; AutoFilter hides rows…
- VBA Find in Text: Use InStr or Search Worksheet CellsTo find one piece of text inside another in Excel VBA, use InStr; it returns the position of the match, or 0…
- VBA Find the Last Column in ExcelTo find the last nonempty column in a particular row, start at the worksheet’s far-right column and move left with End(xlToLeft). To…
- VBA Find Last Column With Data: Reliable VBA MethodsTo find the last column containing a value or formula anywhere on a worksheet, use VBA’s Range.Find method with SearchOrder:=xlByColumns and SearchDirection:=xlPrevious.…
- VBA Find in Array: Choose the Right Search MethodTo find a value in a VBA array, loop from LBound to UBound and compare each element with the value you want.…
- VBA Find in a String: InStr, Examples, and OptionsTo find text inside a VBA string, use the InStr function. It returns the position of the first match, or 0 if…
- VBA Find in Range: Search Cells and Return MatchesTo find a value in an Excel range with VBA, use the range’s Find method and check whether it returned a cell:…
- VBA Find: Check Whether a String Contains a SubstringIn VBA, use InStr to check whether one string contains another: if the function returns a number greater than zero, the substring…
- VBA Find If: Check Whether a Value Exists in ExcelIn Excel VBA, use the Range.Find method to look for a value, then test whether the returned range is Nothing: If foundCell…
- VBA Find: How to Handle a Failed SearchIn Excel VBA, handle a failed Range.Find search by checking whether its result is Nothing before using it. Finding no match is…
- VBA Find First Empty Cell in a ColumnTo find the first truly empty cell in column A with VBA, scan from the top and test each cell with IsEmpty.…
- VBA Find and Replace: Methods, Examples, and Tips in ExcelIn Excel VBA, use Range.Find to locate matching cells and Range.Replace to change matching content. For example, Worksheets("Data").Range("A1:D100").Replace What:="pending", Replacement:="complete", LookAt:=xlWhole replaces…
- VBA Find Exact Match: Use Find with xlWholeTo find a cell whose entire contents match a value in Excel VBA, use Range.Find with LookAt:=xlWhole. For example, search a defined…
- VBA Find a Value in a Column: Methods and ExamplesTo find a value in an Excel column with VBA, use the Range.Find method on the column and specify whether the match…
- VBA Find a Value in a Range: Excel Code and ExamplesIn VBA, use Excel’s Range.Find method to search a range and return the matching cell; check whether the result is Nothing before…
- VBA Find After: How Excel Chooses the Search Start CellIn Excel VBA, the After argument in Range.Find tells Excel which single cell to search after when beginning a find. Excel starts…
- VBA Find a Plumber in an Excel Contact ListTo find plumber listings in an Excel contact list with VBA, search the column that contains service categories or descriptions, then review…
- VBA: How to Find an Accredited VA PractitionerIf by VBA you mean the U.S. Department of Veterans Affairs’ Veterans Benefits Administration, use VA’s official accreditation search to find an…
- VBA Find a Character in a StringIn VBA, use the InStr function to find a character in a string: it returns the character’s position, or 0 if the…