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 with same structure 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 diff...
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

Excel VBA clear cell contents with ClearContents Method

This Excel tutorial explains how to clear cell contents / clear cell formats using Clear, ClearContents, ClearFormats Method. Excel VBA clear cell contents There are several kinds of "clear" related Excel VBA Methods for different scenarios. I will also explain how to clear single cell contents, clear merged cells contents, and clear blank cells. Clear single cell contents with ClearContents There are two ways to clear single cell contents (clear value in a Cell but not formatting) As...
Read More

Excel Delete Blank Rows

This Excel tutorial explains how to delete blank rows in Excel with VBA and without VBA. You may also want to read: Excel delete blank rows and blank cells before import into Access Excel delete duplicated data in consecutive rows Excel Delete Blank Rows Sometimes we have data that contains blank rows, one example is data with pivot table layout where data are grouped together and repeated items are blank. Previously I wrote a post about filling blank rows, this post is about delet...
Read More

Excel VBA separate line break data into different rows

This Excel VBA tutorial explains how to separate line break data into different rows. You may also want to read: Access Excel remove line break and carriage return Excel VBA delimit Cell value into rows Excel VBA separate line break data into different rows Recently I received a report from a HR system which is claimed to be a standard report. In the report, some data are grouped into one Cell and are separated by line break. I found this report format totally unacceptable. From th...
Read More