Excel VBA sort worksheet tab order

This Excel VBA tutorial explains how to sort worksheet tab in alphabetic order (ascending order or descending order). You may also want to read: Excel Range Sort Method to sort data Use VBA Excel Function to sort data in ascending order Access Excel assign number for custom sorting sequence Sort worksheet tab by name When you have a lot of worksheets in a workbook, you may want to sort them in alphabetic order for easy searching. As a behavior of Excel sorting, when an arr...
Read More

Excel VBA consolidate multiple workbooks into one workbook

This Excel VBA tutorial explains how to consolidate multiple workbooks into one workbook. You may also want to read: Excel VBA Consolidate worksheets into one worksheet Excel VBA combine worksheets columns into one worksheet Consolidate multiple workbooks into one workbook Assume that you have a lot of workbooks, each workbook contains multiple worksheets. You may want to copy all worksheets of each workbook into a master workbook. For example, I have a folder called "sample" under...
Read More

Excel VBA reformat merged cells to row

This Excel tutorial explains how to use Excel VBA to reformat merged cells to row. You may also want to read: Fill Blank Rows or blank Cells Seperate line break data into different rows Excel VBA unmerge columns automatically Excel VBA reformat merged cells to row It is difficult to decide the title of this post, I will illustrate with an example. Imagine a Table with column A being a merged cell, and column B are the items under the same group. When you apply filter on c...
Read More

Excel VBA generate non-duplicated random number

This Excel VBA tutorial explains how to generate non-duplicated random number using Excel VBA. You may also want to read: Generate random letter A to Z Generate random HKID Hong Kong ID Excel VBA generate non-duplicated random number In my previous post, I demonstrated how to assign random number to a value using Rank Function and Rand Function. In this post I will introduce a more direct approach to assign a random number with the help of VBA. In this approach, each time after a r...
Read More

Add password to all Excel workbook in folder

This Excel VBA tutorial explains how to add password to all Excel workbook in folder and how to mass remove password. You may also want to read: Excel VBA protect worksheet with password Excel VBA hide worksheet with password (xlVeryHidden) Protect VBA code with password Add password to all Excel workbook in folder In many organizations, employees are required to add password to Excel before sending workbooks through email, or before putting workbooks in network drive. If you have ...
Read More

Excel VBA combine worksheets columns into one worksheet

This Excel VBA tutorial demonstrates how to combine worksheets columns into one worksheet. You may also want to read: Excel VBA Consolidate worksheets into one worksheet Excel VBA consolidate multiple workbooks into one workbook Excel convert data from column to row Excel VBA combine worksheets columns into one worksheet There are two types of combine worksheets Worksheets have the same structures / headers, create a blank worksheet and paste the data from different worksheets dow...
Read More

Excel VBA compare worksheets

This Excel tutorial explains how to use Excel VBA to compare worksheets. You may also want to read: Excel compare Worksheets using Compare File Excel compare worksheets Compare worksheets is to compare worksheets of similar structures but different values. Excel has a built it function called Compare File in Office Professional Plus 2013 or Office 365 ProPlus. After comparison is complete, two worksheets are compared side by side and you get the below result indicating all the difference...
Read More

Excel VBA export Excel to Word

This Excel VBA tutorial explains how to export Excel to Word. You may also want to read: Export Excel to PDF Excel VBA export Excel to Word In the previous post, I demonstrated how to export Excel to PDF, which is very easy because there is already a built in function to do that (using Save As and choose PDF). However, there is no built in function to export Excel to Word. Fortunately Excel cell is actually a table in Word, we can simply copy the cells and paste to Word. This tutorial ex...
Read More

Excel add password to workbook

This Excel tutorial explains how to add password to workbook with VBA and without VBA. You may also want to read Add password to all Excel workbook in folder Different kinds of workbook protection There are several kinds of protection in Excel. Add password to workbook. Users are asked to open the Excel file with password. Protect workbook with password. Protect the structure of all worksheets (do not allow insert, delete, rename, move, copy, hide or unhide worksheets) Hide w...
Read More

Excel delete blank rows and blank cells before import into Access

This Access tutorial explains how to delete blank rows and blank cells in Excel before import into Access. You may also want to read: Excel Delete Blank Rows Import Chinese CSV to Excel Import Excel File into Access When you import an Excel file into Access, you may come up with several issues regarding Excel blank cells. Excel blank cells are not considered as Null value in Access Excel blank rows after the last record are also imported Excel blank columns after the last column a...
Read More