VBA Guides

    This page lists every VBA tutorial on Statology.

    Operations
    VBA: How to Count Number of Sheets in Workbook
    VBA: How to Check if Sheet Exists
    VBA: How to Extract Data from Another Workbook
    VBA: How to Run Macro When Cell Value Changes
    VBA: How to Use Zoom
    VBA: How to Use FileDateTime Function
    VBA: How to Save and Close Workbook
    VBA: How to Get Workbook Name
    VBA: How to Check if Workbook is Open
    VBA: How to Get a List of All Open Workbooks
    VBA: How to Open Workbook from Path
    VBA: How to Save Sheets as CSV Files
    VBA: How to Open a Text File
    VBA: How to Open a CSV File
    VBA: How to Open a PDF
    VBA: How to Print Sheet to PDF
    VBA: How to Use Print Preview
    VBA: How to Set Print Area
    VBA: How to Add New Sheets
    VBA: How to Loop Through Sheets
    VBA: How to Add New Line to Message Box
    VBA: How to Create Message Box with Yes/No Responses
    VBA: How to Exit Sub on Error
    VBA: How to Use Exit IF Statement
    VBA: How to Get Sheet Name
    VBA: How to Reference a Named Range
    VBA: How to Delete Named Range
    VBA: How to Delete Charts
    VBA: How to Delete Sheet if Name Contains Specific Text
    VBA: How to Delete Sheets Without Prompt or Warning
    VBA: How to Delete Empty Rows
    VBA: How to Delete Files
    VBA: How to Delete Folders
    VBA: How to Create Folders
    VBA: How to Check if File Exists
    VBA: How to Move Files
    VBA: How to Copy Files
    VBA: How to Copy a Folder
    VBA: How to List Files in Folder
    VBA: How to Open All Files in Folder
    VBA: How to Rename a File
    VBA: How to Comment a Block of Code
    VBA: How to Return a Value from a Function
    VBA: How to Return Array from Function
    VBA: How to Use Intersect
    VBA: How to Use Union
    VBA: How to Copy Range to Another Sheet
    VBA: How to Copy Rows to Another Sheet Based on Criteria
    VBA: How to Copy Visible Rows to Another Sheet
    VBA: How to Paste Values Only with No Formatting
    VBA: How to Paste Values and Keep Formatting
    VBA: How to Count Number of Used Columns
    VBA: How to Count Number of Rows in Range
    VBA: How to Count Rows in Table
    VBA: How to Count Rows in Selection
    VBA: How to Get Row Number from Range
    VBA: How to Get Column Number from Range
    VBA: How to Insert Multiple Rows
    VBA: How to Insert Row with Formatting
    VBA: How to Insert Multiple Columns
    VBA: How to Select Range from Active Cell
    VBA: How to Use FormulaR1C1 Property
    VBA: How to Set Cell Value in Another Sheet
    VBA: How to Get Cell Value from Another Sheet
    VBA: How to Read Cell Value into Variable
    VBA: How to Hide Rows Based on Criteria
    VBA: How to Freeze Panes
    VBA: How to Unhide All Sheets
    VBA: How to Unhide All Rows
    VBA: How to Unhide All Columns
    VBA: How to Merge Cells with the Same Values
    VBA: How to Change Column Width
    VBA: How to AutoFit Columns
    VBA: How to Change Row Height
    VBA: How to Transpose a Range
    VBA: How to Calculate Absolute Values
    VBA: How to Calculate Logarithms
    VBA: How to Use Wildcards
    VBA: How to Use “NOT LIKE”
    VBA: How to Use Like Operator
    VBA: How to Change Font Color
    VBA: How to Set Font Size
    VBA: How to Make Font Bold
    VBA: How to Center Text
    VBA: How to Wrap Text
    VBA: How to Select All Cells with Data
    VBA: How to Highlight Cells
    VBA: How to Highlight Rows
    VBA: How to Highlight Top N Values in Column
    VBA: How to Reverse a String
    VBA: How to Check if String Contains Another String
    VBA: How to Count Occurrences of Character in String
    VBA: How to Use IsNumeric to Check if Cell is a Number
    VBA: How to Use IsDate to Check if Cell is a Date
    VBA: How to Use IsText to Check if Cell is Text
    VBA: How to Write a Case Statement
    VBA: How to Convert String to Double
    VBA: How to Convert String to Integer
    VBA: How to Convert String to Long
    VBA: How to Convert String to Date
    VBA: How to Convert Column Number to Letter
    VBA: How to Use Substitute
    VBA: How to Use Find and Replace
    VBA: How to Extract Text Between Two Characters
    VBA: How to Replace Characters in String
    VBA: How to Remove Numbers from String
    VBA: How to Remove Characters in String
    VBA: How to Remove Last Character from String
    VBA: How to Remove First Character from String
    VBA: How to Remove Spaces from String
    VBA: How to Remove Leading and Trailing Spaces
    VBA: How to Remove Special Characters from String
    VBA: How to Specify a Tab Character
    VBA: How to Convert Strings to Proper Case
    VBA: How to Convert Strings to Upper Case
    VBA: How to Convert Strings to Lower Case
    VBA: How to Remove Duplicate Values
    VBA: How to Remove Borders from Cells
    VBA: How to Remove Cell Fill Colors
    VBA: How to Delete Columns
    VBA: How to Delete Rows Based on Cell Value
    VBA: How to Calculate Time Difference
    VBA: How to Use TimeValue Function
    VBA: How to Insert a Timestamp
    VBA: How to Compare Dates
    VBA: How to Compare Strings
    VBA: How to Find First Day of Month
    VBA: How to Find Last Day of Month
    VBA: How to Get Month Name from Date
    VBA: How to Get Month and Year from Date
    VBA: How to Use EoMonth Method
    VBA: How to Add Days to Date
    VBA: How to Subtract Days from Date
    VBA: How to Use WorkDay Function
    VBA: How to Use NetworkDays Function
    VBA: How to Calculate Days Between Two Dates
    VBA: How to Convert Date to Week Number
    VBA: How to Use DateSerial Function
    VBA: How to Use Weekday Function
    VBA: How to Use WeekdayName Function
    VBA: How to Use mm/dd/yyyy as Date Format
    VBA: How to Use DateValue Function
    VBA: How to Sum If Between Two Dates
    VBA: Countif Greater than Date
    VBA: How to Concatenate Strings
    VBA: How to Split String into Array
    VBA: How to Split String Based on Multiple Delimiters
    VBA: How to Convert Text to Columns
    VBA: How to Count Cells with Specific Text
    VBA: How to Check if Cell is Blank
    VBA: How to Use IsNA
    VBA: How to Use IfNa
    VBA: How to Use “If Not Blank”
    VBA: How to Fill Blank Cells with Value Above
    VBA: How to Use IF AND to Test Multiple Conditions
    VBA: How to Use IF OR to Test Multiple Conditions
    VBA: How to Use IF NOT
    VBA: How to Use IFERROR
    VBA: How to Use IsError Function
    VBA: How to Use MOD Operator
    VBA: How to Use Formula for “If Cell Contains”
    VBA: How to Sort Sheet by Multiple Columns
    VBA: How to Sort Values Alphabetically
    VBA: How to Sort by Date
    VBA: How to Clear Formatting from Cells
    VBA: How to Clear Filters
    VBA: How to Clear Contents if Cell Contains Specific Value
    VBA: How to Filter a Column
    VBA: How to Use AutoFilter with Multiple Criteria
    VBA: How to Use “Not Equal to” in AutoFilter
    VBA: How to Use Floor Function
    VBA: How to Round Up Values
    VBA: How to Round Down Values
    VBA: How to Round Values to 2 Decimal Places
    VBA: How to Use MATCH Function with Dates
    VBA: How to Use INDEX MATCH
    VBA: How to Use INDEX MATCH with Multiple Criteria
    VBA: How to Use HLOOKUP
    VBA: How to Use VLOOKUP
    VBA: How to Use VLOOKUP From Another Sheet
    VBA: How to Use XLOOKUP
    VBA: How to Use SUMPRODUCT
    VBA: How to Use Pi in Calculations
    VBA: How to Create a Factorial Function
    VBA: How to Refresh Pivot Tables
    VBA: How to Filter Pivot Tables
    VBA: How to Find Last Used Row
    VBA: How to Find Last Used Column
    VBA: How to Find Value in Column
    VBA: How to Use RandBetween to Generate Random Numbers
    VBA: How to Format Cells as Percentage
    VBA: How to Format Time
    VBA: How to Format Cells
    VBA: How to Apply Conditional Formatting to Cells
    VBA: How to Apply Conditional Formatting to Duplicate Values

    Descriptive Statistics
    VBA: How to Write SUMIF and SUMIFS Functions
    VBA: How to Write COUNTIF and COUNTIFS Functions
    VBA: How to Write AVERAGEIF and AVERAGEIFS Functions
    VBA: How to Calculate Average Value of Range
    VBA: How to Calculate Weighted Average
    VBA: How to Calculate Standard Deviation of Range
    VBA: How to Use LinEst Function to Fit Regression Models
    VBA: How to Find Max Value in Range
    VBA: How to Find Minimum Value in Range
    VBA: How to Sum Values in Range
    VBA: How to Count Unique Values in Range
    VBA: How to Get Unique Values from Column
    VBA: How to Use COUNTA to Count Non-Empty Cells in Range
    VBA: How to Rank a List of Values
    VBA: How to Use Subtotal Function

    Visualizations
    VBA: How to Create a Bar Chart
    VBA: How to Create a Pie Chart