Excel VBA

Cell and Range Manipulation:

  • Cells and Range Property – Learn how to reference cells & objects in Excel using the Cells and Range property. Discover the differences and limitations of each.
  • Delete Cell Contents – Delete cell contents in Excel using VBA. Learn to target specific cells, ranges, columns, rows, and even conditionally delete based on criteria.
  • Delete Empty Rows – Automate the process with a simple script! Learn how to find and delete empty rows efficiently, keeping your data clean and organized.
  • Delete a Row – This guide will show you how to delete specific rows and multiple rows at once using macros and range selection.
  • Detect If Range Is Empty – Detect if a certain cell or range is empty in Excel with the help of Visual Basic for Applications (VBA). 
  • Change Text in Cell – How to input text in a certain cell and manipulate cell values using VBA.
  • Change the Chart Name – Rename charts in Excel using VBA. Learn the difference between chart object names and display titles, and write code to automate renaming for clear and organized charts.
  • Selecting a Range Using Variables – Select a range in Excel using the range function, with code examples.
  • Set Range to Empty – Learn how to set a range to be empty with VBA.
  • Collapse Columns in Excel – Looking to hide or collapse columns in Excel? Learn how to use VBA to control the visibility of certain data within your workbook.
  • Get the Current Row – Learn how to get the current row in a spreadsheet using Excel VBA. Identify the active row in your worksheet easily.

Data Manipulation:

  • Add Data to Table – Learn how to insert rows and columns into an Excel table & add data using Excel VBA.
  • Add Text to Cell – Add text to a cell in Excel using ampersand “&”. Also, add text to all cells in a column and based on cell color.
  • Combine Duplicate Rows and Sum the Values – Automatically combine duplicate rows and sum values in Excel using VBA. A handy tool for data cleaning and preparation.
  • Compare Two Columns in Excel and Highlight Matches – Compare values in two Excel columns and highlight matches using VLOOKUP and VBA code. Use an additional column as a comparison or modify cell formats.
  • Concatenate Array – Concatenate text strings using Excel VBA in this tutorial. With four different methods explained, you can work around the lack of a built-in CONCATENATE function in VBA.
  • Copy and Paste Multiple Selections – Learn how to efficiently copy and paste multiple selections in Excel using VBA with this comprehensive tutorial. Gain insights into defining ranges, copying data, and leveraging PasteSpecial for enhanced automation.
  • Copy and Paste Pivot Table Values With Formatting – how to efficiently copy and paste pivot table values with formatting using VBA in Excel. This tutorial provides step-by-step instructions to create a VBA macro that automates the process, allowing you to replicate pivot table data accurately and streamline your Excel workflow.
  • Copy and Paste Values – Copy and paste values in Excel with multiple examples. Copy columns or rows between sheets with ease. Get step-by-step instructions today.
  • Copy Dynamic Range in Excel Sheet – Copy static and dynamic ranges in Excel using VBA
  • Copy Formula Down – Use VBA to copy formulas in Excel easily! This tutorial shows how to sum up NBA player stats and automate the process with a simple code.
  • Count Rows – Learn two methods to count rows in Excel VBA – including Range.End and UsedRange.Rows.Count.
  • Count the Number of Rows – Count rows in Excel using VBA code. Get the last row in a column or sheet.
  • Fill Blank Cells With the Value Above – Automate the task of filling blank cells with the value from the cell above in Excel using VBA. Create a VBA macro that efficiently handles large datasets, eliminating manual work.
  • Filter Blank Cells – Automate the process of filtering blank cells in Excel using VBA code to save time and improve accuracy.
  • Filter Excel Pivot Table – Filter Pivot Tables with VBA code. This article shows different ways to filter data using Excel’s powerful tool. Create Pivot Tables in VBA and manage your data effectively.
  • Filter Out Multiple Criteria – Learn how to automate filtering options in Excel with VBA.
  • Get Values from Another Sheet – Automatically calling the sheet through VBA. Learn how to automate sheet calling in Excel using VBA module.
  • If Cells Contain Text Then Use Formatting – Learn to find and format text values in Excel using two different methods: go to special feature and formatting cells with a macro.
  • Generate Random Numbers – Generate random numbers in Excel VBA using RND, RANDBETWEEN, and RANDARRAY functions. Use it for statistical data analysis or lucky draws.
  • Get All Unique Values – Extract unique values from a range in Excel Office 365 with VBA code or UNIQUE formula.
  • Get Cell Value – Learn how to automate your work with Visual Basic for Applications (VBA). In this article, we explain how to get cell value with VBA code in Excel.
  • Get Row Number – Learn how to use VBA to get row numbers with cell change in this tutorial.
  • Get Textbox Value – Create a Textbox in User Form on Excel using Visual Basic for Applications.
  • Get the Cell Format – Format of a cell in Excel VBA with this tutorial. Follow the steps to determine whether the cell is Text, General, Number, or Date.
  • Get the Length of an Array – Learn how to get the length of an array in VBA. The array is declared and values are assigned to it before computing the length.
  • Get Value From Listbox – Learn how to create a UserForm in Excel and use the ListBox option to create a convenient list.
  • Sort Data by Date – Learn how to sort data by date in Excel using VBA. Discover why using VBA can be useful, and how to store and reuse your code for repetitive actions.
  • Sum Function – Sum a range inside an Excel worksheet using VBA code. Modify the code and return the value in an active cell.
  • Sum Range – Add all the numbers in a range of cells using Excel VBA. This tutorial covers seven methods for summing in Excel VBA.
  • Copy range – Learn how to copy ranges in VBA: values, cells, and formatting. Copy to the same or another worksheet.
  • Delete a Row if the Cell Contains – Delete rows in Excel that contain specific text with just one click using VBA.
  • Range Set Value – Learn how to set values to a range of Excel cell with VBA. This tutorial covers how to set the value for a single cell as well as multiple cells.
  • range.row – Learn how to use the Range.Row property in VBA code to select the first row of a selected range.
  • range.rows – Manipulate rows in Excel using VBA’s Rows property. Explore techniques such as deleting specific rows, counting rows within a range, and highlighting even rows to streamline your data management tasks.
  • Merge and Unmerge Cells – Use VBA to merge and unmerge cells in Excel.
  • Merge Cells With the Same Values – Learn how to merge cells in Excel with the same data in adjacent cells. This tutorial explains how to do it manually and with VBA code.
  • Multiply Cells – Learn how to multiply ranges of cells in Excel using VBA.
  • Search Data in Google – Use Excel VBA to search for data from Google and analyze it. Set up developer tools in Excel and write a basic Google search query.
  • Set Excel Cell Value to Variable – Learn how to select and assign values in VBA for your Excel sheets including setting cell value to a certain variable.
  • Sort Columns in Table – Learn how to sort columns in tables in Excel using VBA.
  • Sort Range – Sort data within a range using VBA. Learn how to specify the key and order to sort columns in Excel with this helpful code and explanation.

String Manipulation:

  • Add New Line (Carriage Return) in String – Add a line break in Excel VBA using constants like vbNewLine, vbCrLf, vbLf and vbCr.
  • Break Long String to Multiple Lines – Break a long string into multiple lines in VBA with this easy tutorial. Keep your code readable and clear for future users.
  • Capitalize All Letters – Use VBA in Excel to automatically capitalize all letters in a string for better consistency and readability.
  • Escape Single Quotes and Double Quotes – Escape single and double quotes in Excel VBA. Discover how to use extra double quotes to escape double quotes in text strings assigned to properties or variables.
  • Use Vbcrlf – Discover how to use Vbcrlf in VBA to create new lines in MsgBox or string operations, effectively managing and structuring your outputs.
  • Insert an Apostrophe – Discover steps for inserting apostrophes at the start of a string or within a string, ensuring accurate text handling in your Excel worksheets.
  • Insert Double Quotes in a String – Recognize strings in VBA with double-quotes & how to display them as a message with additional quotes.
  • Remove Hidden Double Quotes – Remove hidden double quotes in Excel using VBA.
  • Add Text Based on Cell Value – Use the conditional function IF in Excel to display text based on another cell. Create more complex conditions with multiple arguments.
  • Find and Replace Regex – Use regular expressions in Excel with VBA code. Follow simple steps to add reference and write a regex to find and replace data efficiently.
  • Find and Replace in Header and Footer – Replace text in Excel using the Find and Replace function, and how to replace text in headers and footers using VBA code. Insert and edit headers and footers in Excel.

Data Conversion:

  • Convert Currency To Text – Convert currency to text in Excel using VBA with this step-by-step guide. Access VBA, create formulas, and manipulate large sets of data.
  • Convert Integer to String – Learn how to convert Integer and Long values to strings using Excel VBA, so that you can use string manipulation functions on these values.
  • Convert Named Range into Array – Convert a named range into a two-dimensional array in Excel VBA with our tutorial. Follow two easy methods to access the more powerful options available to arrays.
  • Convert Range from Text to Number – Learn how to convert numbers stored as text to actual numbers using Excel VBA. This tutorial covers 3 methods to convert text to number in Excel.
  • Convert Text to Number – Convert text to numbers in Excel with Visual Basic for Applications (VBA). Find out how to format cells to display numbers.
  • Convert Column Number to Letter – find & convert Excel column label formula. Learn how to find any column label in Excel by converting a column number to a character label.
  • Convert String to Integer – Learn how to convert a string to an integer in VBA by checking whether the string can be converted using the ISNUMERIC function and converting with Cint.

Data Searching:

  • Find a Date – Find a date in Excel using VBA. Write a VBA function to locate the specified date in your dataset and return the cell reference.
  • Find Column Index – Find the column index of a certain text or number in Excel and VBA easily. Follow these steps and write your code in Visual Basic Editor.
  • Find Duplicate Values in Different Excel Sheets – Learn how to efficiently find duplicate values across different Excel sheets using VBA with this comprehensive tutorial. Enhance your data-cleaning process and maintain dataset quality effortlessly with Excel VBA.
  • Find the Cell Color – Excel Visual Basic for Applications (VBA) can automate and enhance Excel. Learn how to find the color of a particular cell using VBA.
  • Find the Date in the Column – Find specific values in Excel with VBA! Automate your work and save time.
  • Find the Maximum and Minimum Value in the Range – Find the minimum and maximum values in a range using VBA.
  • Find the Row Number of a Specific Value – Find the row number of a specific value in Excel using VBA with this comprehensive tutorial. Define search parameters, write VBA code, and run the macro, streamlining your workflow and minimizing errors in large datasets.

Worksheet Manipulation:

  • Activate Worksheet – Learn 3 Ways to Select a Worksheet Using VBA Code: Activate Worksheet by Its Name, By Index Number, and By Variable Name.
  • Add Sheet at the End of All Sheets – Excel VBA can be used to add sheets at the end of the sheets list.
  • Create a New Sheet – Add new sheets or worksheets to an Excel workbook using VBA or keyboard shortcuts.
  • Create an Array of Sheets – Learn about arrays in VBA! Arrays are variables that store multiple values of the same type. Create static arrays of sheets with this tutorial.

Workbook Manipulation:

  • Close Workbook Without Saving – Learn how to close your Workbook in Visual Basic for Applications (VBA) without saving in just a few steps.
  • Create and Save New Workbook – Automate your Excel work with Visual Basic for Applications (VBA).
  • Hide a Sheet – Hide Excel sheets using VBA code with this comprehensive tutorial.
  • Hide and Unhide Rows or Columns – Unhide rows and columns in Excel VBA to protect specific data from unauthorized people or get a total view of a spreadsheet’s contents.

Conditional Formatting:

Condition Checking:

  • Check Cell Color – Check cell background and font color in Excel using VBA. Use a simple function to determine the color index with this tutorial.
  • Check If A File Is Open or Closed – Learn how to check if a workbook is open or closed using Excel VBA. This tutorial demonstrates two methods in VBA to determine if a file is open or not.
  • Check If an Array Is Empty – Check if an array is empty in VBA with a function. Understand the differences between static and dynamic arrays in VBA.
  • Check If String Has Special Characters – Learn how to use VBA to check for special characters in an Excel string. Our formula will identify anything that’s not a number or letter from the English alphabet.
  • Check Multiple Conditions in an If Statement – Check multiple conditions in an If statement in VBA. If-Then-Else statements allow for smarter program choices.
  • Check the Format of a Cell – Check the format of a cell in Excel using VBA with this comprehensive tutorial. Explore examples to retrieve the formatted value of a cell, check if a cell contains a number, and leverage Excel VBA’s capabilities to automate tasks efficiently. Enhance your Excel skills and streamline your workflow with VBA automation today.
  • Checking for Non-Empty Values – Automate repetitive actions in Excel with VBA. Learn how to efficiently find non-empty values in your file.
  • The If Statement is Based on the Cell Color – Check cell color in Excel using VBA to describe cells based on their color. Learn how to set indicators for red, yellow, and green & create IF statement based on color.
  • Check if a Cell Contains a Letter or String – Learn how to create a VBA macro to check if a string contains a letter or a string.
  • Check if Cell is Empty – Check if a cell is empty in VBA with the IsEmpty function. Follow this example to display a message window to show which cell is empty.
  • Multiple IFS – Learn how to use multiple if statements in VBA with different examples, including nested if statements. Avoid convoluted syntax and embrace elegant solutions.
  • If Then Else – Learn how to use the IF statement in VBA. Control the execution of code and only run it when certain conditions are met.

Filtering and Clearing:

  • Clear All Filters – Learn how to clear all filters in VBA quickly and easily. Follow our guide and enter a simple code to clear filters in Excel.
  • Clear Memory – How to fix the Excel VBA Out of Memory error (Run-time error 7) by identifying its causes and clearing memory in Excel VBA.
  • Clear Range – Learn how to clear ranges in Excel using VBA code. Delete specific formats, comments, and more.
  • Clear Selection – Learn how to clear selection in VBA using Excel in this guide. Follow the simple steps to clear a left-out selection or selected range while automating your Office files.

File Operations:

  • Create and Write to a Text File – Transfer data from Excel to a text file using VBA. This tutorial explains how to create a text file and write to it using the FileSystemObject and CreateTextFile method.
  • Get File Path – Display the file path to the current workbook in Excel using VBA.
  • Give a File Path – Specify file paths in VBA for efficient file manipulation. This tutorial covers both absolute and relative file paths, using variables for dynamic paths, error handling best practices, and a full code snippet for opening a text file.
  • Save a Text File with UTF-8 Encoding – Learn how to save a text file with UTF-8 encoding in Excel VBA using a simple code. This will allow you to use international characters in your files.
  • Save Excel Worksheet as CSV – Learn how to use VBA to automate your work and manipulate any Office application (mostly Excel) with this tutorial on saving an Excel worksheet as a CSV file.
  • Saving XLSX File – Learn how to save an Excel file using VBA code or by opening the Save As window. Get a quick way to save the XLSX file using a single line of code.
  • Open CSV File – Open a CSV file with VBA in Excel and use the FileDialog option to choose CSV files among all other files in the folder. Follow our step-by-step guide now.
  • Open Workbook as Read-only – Learn how to use VBA code to open an Excel workbook in read-only mode. Follow these simple steps and get it done easily. Alt + F11 shortcut included.
  • Save as – Learn how to save an Excel workbook in VBA using Alt + F11, default location or specified location with code examples.
  • Read a Text File – Read text files line by line in Excel VBA with two methods. The first displays the entire text file on a worksheet, while the second retrieves specific data.
  • Check if File Exists – Learn how to check if a file or directory exists in VBA using the Dir method. Follow this simple Subroutine to ensure your file exists.

Formatting:

  • Format a MsgBox – Visual Basic for Applications (VBA) tutorial on formatting a MsgBox function, which displays custom messages in MS Office applications.
  • Format Column as Text – Learn how to format any column as text with VBA in Excel.
  • Format Date in Header or Footer – Learn how to format the date in Excel’s header or footer using VBA code. Customize your date format in headers or footers easily!
  • Format Date – Learn how to format dates in VBA using NumberFormat property. Increase efficiency of Excel tasks through VBA in a faster way.
  • Format Percentages – Learn how to format percentages in Excel VBA with this tutorial. Apply the percentage number format to your dataset and display numbers as percentages.
  • Format Textbox Phone Number – Create and manipulate User Forms in VBA, assign code, and use built-in codes to format Text Box in User Form, in Excel.
  • Borders Around Cells and Ranges – Draw borders around cells, ranges, and selected ranges in Excel using VBA.

Row and Column Operations:

  • Inserting a Row – Learn how to add a new row in Excel with VBA code by recording a macro and analyzing its code. Use caution as undo won’t work when using a macro.
  • Know the Column Number – Retrieve the column number of a selected cell or range in Excel using VBA. Whether you’re navigating through sheets programmatically or addressing cells relative to others, understanding how to determine column numbers is crucial.
  • Move Column – Automate tasks in Excel using VBA. Learn how to move columns with Visual Basic for Application in Excel. Simple and complex tasks can be automated.

Data Retrieval:

  • Find Last Column – Learn how to find the last column number in Excel with ease! Our tutorial covers multiple methods for finding the last column number, even when dealing with blank cells.
  • Find Last Row – Find the last row using VBA code in Excel. Includes examples for locating the last row in the current column or a specific cell.
  • Loop Through Files in Folder – Loop through files in a folder with different examples. Choose between listing all files, or recursively searching folders and saving to a text file.

Range and Selection:

  • Select a Range of Columns – Learn how to select a range of columns in your Excel worksheet using VBA editor with examples, and automate your work.
  • Select All Worksheets – Automate the task of selecting all worksheets in an Excel workbook using VBA. By following these instructions, you’ll be able to create a VBA macro that efficiently selects all sheets in your workbook, saving you time and effort, especially in workbooks with numerous sheets.
  • Select Column in Table – You’ll be able to automate the process of selecting a specific column in your table, streamlining your workflow and saving time.
  • Select Multiple Columns – Learn how to select multiple columns in Excel using VBA with this tutorial. Benefits include greater flexibility and faster processing time.
  • Select Only Cells With Data – Learn how to select cells that contain data in Excel VBA using the Range object and Sub Procedure.
  • Select Range Based on a Variable – Select specific Excel ranges based on different VBA variables, whether absolute or relative, in just a few simple steps.
  • Select Rows With Specific Text – Learn how to select rows in Excel that contain specific text using VBA. Automate this process to save time and effort when dealing with large datasets.
  • Select the Next Cell – Select the next cell in Excel VBA with this comprehensive guide. Whether you’re moving down a column, across a row, or navigating through a range, understanding how to programmatically select the next cell is crucial for efficient VBA programming.
  • Select Only Visible Cells – Learn how to hide rows and columns in Excel using VBA, and select only the cells that are not visible for further manipulation.

Other:

  • Assign a Macro to a Button – Assign a macro to a button in Excel. Follow these easy steps to create a button and assign a macro to it.
  • Chr 34 – Learn how to use VBA Function, Chr, to return the character from the ASCII table. Check out an example of how to use it to add quotes in a cell.
  • Create Pi – Learn how to create and use the Pi function in VBA for Excel. Declare variables, set values, and use the WorksheetFunction object in your code.
  • Clear Clipboard – Learn how to clear Excel clipboards using Excel VBA to prevent unauthorized access to data and optimize system performance. This tutorial shows 2 ways to clear each clipboard.
  • Hyperlinks – Linking, Following, and Managing – Create hyperlinks in Excel VBA to easily navigate within worksheets, other sheets, and websites. Learn how to create, follow, and manage hyperlinks.
  • VBA Type – Create custom data types in VBA using the Type keyword. Combine multiple types into one for improved organization and efficiency.
  • Refresh a Userform – Create user forms in Visual Basic for Applications (VBA) and reset or refresh data.
  • Remove VBA from Excel – Learn how to remove VBA code from your Excel workbook with 5 methods that allow you to make your workbook macro-free for easier sharing and collaboration.
  • Run VBA from Command Line – Learn how to run a VBA macro from the command line. This tutorial includes steps to create a macro to import data from Word tables and a VBScript to run the macro from the command line.
  • Find the Chart Name – A tutorial on how to find the names of charts in Excel using VBA. Useful for editing or manipulating specific charts.
  • INDEX MATCH – How to use Index Match functions in Excel VBA using the WorksheetFunction object. This tutorial includes an example of extracting RAM values from a dataset.
  • Insert Default Value Inside Excel Table – Learn how to insert default values inside Excel Table with VBA. Make Excel change values in our table based on a set of values already in place.
  • Insert an Array Formula – Learn how to insert a multi-cell and single-cell array formula in an array using Excel VBA.
  • Insert Header in Based on Cell Value – Control Excel header with VBA – learn how to insert a header based on a cell value in our sheet. Similarities in all Office programs functioning.
  • Loop Through Array – Learn how to create arrays and loop through them using Visual Basic for Applications in Excel. Automate your work and boost your productivity.
  • Make Excel Update Links – Use VBA to update links in Excel workbooks. Enable, disable, and prompt automatic updates or execute your own code.
  • Pattern Matching – Learn how to use various methods to find patterns and characters in Excel, including the SEARCH and FIND functions.
  • Print Range to an Array – Learn the difference between arrays and ranges in Excel. Discover how to add range in an array in VBA.
  • Reference a Pivot Table – Learn how to reference and manipulate pivot tables in VBA. Whether you need to update the layout, change field positions, or access specific data within the pivot table, understanding these VBA techniques will enhance your Excel automation skills.
  • Turn Screen Updating On and Off – How to speed up VBA code by turning off screen updating. Learn how to do it through Application.ScreenUpdating in Excel.
  • Use the Find Function – Harness the power of Excel’s Find function in VBA with this comprehensive tutorial. From declaring variables to handling search results, each step is explained in detail to help you automate your data search processes efficiently.
  • Use the Intersect Function – Learn how to use the VBA Intersect function in Excel to get the rectangular intersection of several ranges.
  • Use the Square Root – Learn how to use the square root function in Excel VBA to automate calculations and increase your productivity. Find the syntax for the Sqr() function.
  • Use Toggle Button – Create and use Toggle Button in VBA for Excel. It allows users to select between two states and can be used for multiple things!
  • Use VBA Function in Excel Formula – Automate your work in Excel using Visual Basic for Application (VBA). Create your own functions and customize your workbook to fit your needs.
  • Using INDIRECT Function – Use the INDIRECT formula in VBA to evaluate cell references as text strings and retrieve their values. Learn how to do it step by step in Excel.
  • Use Xlookup – Learn about Vlookup, Hlookup, and Xlookup functions in Excel. Xlookup is a new lookup option only available in Office 365. See how it works with VBA.
  • Exit If Statement – Simulate the Exit If statement in your VB code, even though it doesn’t exist, using the GoTo statement.
  • Runtime Error 1004 Application-defined or Object-defined error – Troubleshoot and resolve the VBA Runtime Error 1004, “Application-defined or Object-defined error,” in this guide. From referencing non-existent ranges to handling protected worksheets.
  • Vlookup in VBA – Use Excel’s VLOOKUP function to find values in tables. Understand its syntax, arguments, and how to use it in VBA.
  • Zoom in and Out of Worksheet – Learn how to zoom in and out of an Excel worksheet using VBA in this tutorial. Use the worksheet object’s Zoom method to adjust zoom levels.