Improve Your Excel.com
Everything you need to improve your Excel in one place!
Home Categories Tips By Email Search Contact Us Other Links Your Questions Answered

Excel VBA Examples

Excel Tutorials and Links for VBA examples

  • Adding Leading Zeroes to ZIP Codes


  • Adding Ordinal Notation to Dates


  • Adjusting Comment Printouts


  • Adjusting Values with Formulas


  • Appending to a Non-Document Text File


  • Automatically Closing a Workbook


  • Automatically Converting to GMT


  • Automatically Copying Formatting


  • Automatically Loading Add-ins


  • Automatically Printing a Range


  • Calculating the Interval Between Occurrences


  • Changing Directories in a Macro


  • Changing Fonts in Multiple Workbooks


  • Changing Months in a Workbook


  • Changing Section Headers


  • Changing the Shortcut Menu


  • Choosing Direction After Enter On a Workbook Basis


  • Clearing the Undo Stack in a Macro


  • Coloring Cells with Formulas


  • Combinations for Members in Meetings


  • Combining Columns


  • Comparing Workbooks


  • Concatenating Ranges of Cells


  • Condensing Multiple Worksheets Into One


  • Conditional Page Breaks


  • Conditional Printing


  • Conditionally Deleting Rows


  • Conditionally Displaying a Message Box


  • Controlling Display of Toolbar Buttons


  • Converting an Unsupported Date Format


  • Converting Cells to Proper Case


  • Converting From Relative to Absolute


  • Converting Imported Information to Numeric Values


  • Converting Phone Numbers


  • Converting Text Case


  • Converting Text to Numbers


  • Copying Comments to Cells


  • Copying Headers and Footers


  • Counting All Characters


  • Counting Cells with Text Colors


  • Counting Shaded Cells


  • Counting the Times a Worksheet is Used


  • Counting Unique Values


  • Counting Words


  • Creating a Center Across Selection Button


  • Creating a Directory in a Macro


  • Creating Charts in VBA


  • Creating Individual Workbooks


  • Creating Superscript and Subscript Buttons


  • Deleting a File in a Macro


  • Deleting All Names but a Few


  • Deleting Blank Columns


  • Deleting Every X Rows 2


  • Deleting Every X Rows


  • Deleting Unwanted Styles


  • Deleting Worksheets in a Macro


  • Deriving an Absolute Value in a Macro


  • Detecting Types of Sheets in VBA


  • Determining a Random Value


  • Determining Differences Between Dates


  • Determining If a File Exists


  • Determining If a Number is Odd or Even


  • Determining if Caps Lock is On


  • Determining the Current Directory


  • Determining the Hour of the Day


  • Determining the Length of a String


  • Disabling Printing


  • Displaying the "Last Modified" Date


  • Displaying the Selected Cell's Address


  • Dynamic Headers and Footers


  • Dynamic Worksheet Tab Names


  • Easily Adding Blank Rows


  • Exiting a For ... Next Loop Early


  • Expiration Date for Excel Programs


  • Exporting Black and White Charts


  • Extracting Proper Words


  • Faster Text File Conversions


  • Finding and Deleting Links


  • Finding the Last-Used Cell in a Macro


  • Finding the Parent Folder


  • Forcing Input to Uppercase


  • Forcing Manual Calculation For a Workbook


  • Friendly and Informative Error Handling


  • Full Path Names in Excel


  • Full Path Names in Headers or Footers


  • Generating a List of Macros


  • Getting a File Name


  • Getting Input from a Text File


  • Getting Rid of Extra Quote Marks in Exported Text Files


  • Getting Rid of Many Hyperlinks


  • Getting Rid of Non-Printing Characters Intelligently


  • Grabbing the MRU List


  • Hiding Excel in VBA


  • Highlighting the Rows of Selected Cells


  • Hyperlinks to Charts


  • Inconsistent Output for Empty Columns in a CSV File


  • Inserting and Copying Rows


  • Inserting Dashes between Letters and Numbers


  • Inserting the Saved Date In a Header or Footer


  • Jumping to Alphabetic Worksheets


  • Jumping to the Start of the Next Data Entry Row


  • Last Saved Date in a Footer


  • Limiting Entry of Prior Dates


  • Maintaining the Active Cell


  • Making a Cell's Contents Bold within a Macro


  • Making a Cell's Contents Italics within a Macro


  • Multiple Line Headers and Footers


  • Naming Tabs for Weeks


  • Non-standard Sorting


  • Noting the Workbook Creation Date


  • Numbers Spelled Out


  • Opening an HTML Page in Excel


  • Parsing Non-Standard Date Formats


  • Positioning a Column on the Screen


  • Positive and Negative Colors in a Chart


  • Preserving the Undo List


  • Printing a Single Column in Multiple Columns


  • Printing a Worksheet List


  • Printing Multiple Worksheets on a Single Page


  • Printing Selected Worksheets


  • Printing Workbook Properties


  • Pulling Apart Cells


  • Pulling Apart Characters in a Long String


  • Pulling Cell Names into VBA


  • Pulling Formulas from a Worksheet


  • Putting Cell Contents in Footers


  • Quickly Changing Windows


  • Referencing External Cell Colors


  • Relative VBA Selections


  • Removing Conditional Formats, but Not the Effects


  • Reorganizing Data


  • Replacing and Converting in a Macro


  • Resizing Checkboxes


  • Retrieving Drive Statistics


  • Retrieving Worksheet Names


  • Returning Zero When a Referenced Cell is Blank


  • Running a Macro in a Number of Workbooks


  • Running a Macro When a Workbook is Closed


  • Running a Macro When a Worksheet is Activated


  • Running a Procedure when a Workbook is Opened


  • Saving Information in a Text File


  • Searching a Workbook by Default, Take Two


  • Selecting All Visible Worksheets in a Macro


  • Selecting Cells of a Specific Color


  • Selecting Random Names


  • Selecting the First Cell In a Row


  • Selective Headers and Footers


  • Selectively Importing Records


  • Self-Aware Macros


  • Setting Column Width in a Macro


  • Shading Rows for Ease in Reading Output


  • Sheets for Days


  • Sheets for Months


  • Shortcut for Pasting Only Values


  • Shortening ZIP Codes


  • Showing Filter Criteria on a Printout


  • Simultaneous Scrolling


  • Sizing Text Boxes and Cells the Same


  • Skipping Hidden Rows in a Macro


  • Snapshots of Excel Worksheets for PowerPoint


  • Sorting by Fill Color


  • Sorting Data Containing Merged Cells


  • Sorting Data on Protected Worksheets


  • Specifying Date Formats in Headers


  • Specifying the Size of Chart Objects


  • Spreading Out a Table


  • Suppressing the Reviewing Toolbar on E-mailed Workbooks


  • Swapping Two Strings


  • Toggling AutoFilter


  • Trimming Spaces from Strings


  • Turning Off AutoFill for a Workbook


  • Understanding Functions in Macros


  • Understanding the If ... End If Structure


  • Unhiding a Single Column


  • Unhiding Multiple Worksheets


  • Unique Name Entry, Take Two


  • Unlocking Charts


  • Unprotecting Groups of Worksheets


  • Updating Multiple PivotTables at Once


  • Using a Different Footer on Secondary Pages


  • Using a Progress Indicator in Macros


  • Using an Exact Number of Digits


  • Using BIN2DEC In a Macro


  • Using Excel for Timing


  • Using InputBox to Get Data


  • Using Multiple Print Settings


  • Using Seek In a Macro


  • Using the Camera in VBA


  • Using the Status Bar


  • Working With Multiple Printers


  • Zooming With the Keyboard



  • Want more tips? Subscribe to our Free Newsletter today and we will send them to you.

    Most Popular Categories |Bar_Charts |Charts |Pie_Charts |Excel Counting |Excel Filters |Pivot_Tables |Excel_Keyboard_Shortcuts |Conditional_Formating |VLookup |Games |Names_and_ranges |VBA_Examples |Macros