Access replace Crosstab Query with Expression

This Microsoft Access tutorial explains how to replace Crosstab Query with Expression in order to add multiple aggregate values. Access replace Crosstab Query with Expression In previous post, I have introduced how to use Crosstab Query to build a matrix report. However, Crosstab Query has a limitation that it can only add one aggregate value in the report, which is the Sum of amount in the above example. I also don't like the fact that I need to define the order of the month in the Pro...
More

Excel delete all comments in Workbook

This Excel tutorial explains how to delete all Comments in Workbook using VBA and without using VBA. You may also want to read: Excel show all comments in worksheet Excel consolidate all Comments in the workbook Excel - delete all Comments in Worksheet In Excel spreadsheet, if you know where the comments locate, you can delete multiple Comments by selecting multiple Cells, then right click on any selected Cells > select Delete Comment.   If you are not certain where ...
More

Excel compare time or apply condition on timestamps

This Excel tutorial explains how to compare time or apply condition on timestamps in Excel spreadsheet Excel compare time or apply condition on timestamps When we have two timestamps (a date with time) on the same date, we can use simple subtraction on the two timestamps to compare. If the two timestamps have different dates, we can still minus the timestamps to compare. But if we only want to compare the time only without considering the date, we need to extract the time portion of time...
More

Access VBA change Query criteria using QueryDef.SQL Property

This Access VBA tutorial explains how to change Query criteria in VBA using QueryDef.SQL Property. You may also want to read: Create Query using CreateQueryDef Access VBA - change Query criteria It is easy to change Query criteria in Query View, but sometimes your criteria may depend on a variable that is not a constant. In Access VBA, you can change the Query criteria using QueryDef.SQL Property. In fact, QueryDef.SQL does not really update just the update the criteria of the statement,...
More

Excel VBA declare Global Variable and variable scope

This Excel VBA tutorial explains how to declare private variable, global variable / public variable in VBA, and explain the scope of variable. You may also want to read: Function, Sub, Method, Property Difference between Dim and Set Scope of local variable / global variable / private variable Procedure Level When you declare a variable inside a Sub Procedure or Function (local variable), the variable can only be used within them. For example, in Sub Procedure1, you have declared...
More

Excel change default delimiter of CSV files

This Excel tutorial explains how to change default delimiter of CSV files from comma to other symbols. You may also want to read: Excel VBA convert CSV to Excel Excel change default delimiter of CSV files When you open a CSV file in Excel, you can see all columns are delimited by comma, you don't have to define which character you want to use to delimit the row. It is because the default delimiter of comma is configured at Windows level, all Windows applications (including Excel) will us...
More

Excel VBA convert CSV to Excel

This Excel tutorial explains how to convert CSV to Excel in Excel VBA. You may also want to read: Access Excel FSO File Methods Import Chinese CSV to Excel Convert CSV to Excel in Excel VBA CSV is a commonly used format when you need to interface data from one system to another system. For modification purpose, it is best to convert to Excel format because it can contain formatting. This tutorial demonstrates how to write a Macro to convert all CSV files in a folder to Excel. VBA Cod...
More

Quickly search email in Outlook using criteria

This Microsoft Outlook tutorial explains how to search email in Outlook using criteria and logical operators. Search email in Outlook If you receive dozens of emails everyday, it is extremely difficult to search a specific email or relevant emails. I have seen most people would sort by date and then sort by sender / receiver to search email, but it is extremely time consuming. Microsoft Outlook has a Search Tool which allows you specify the criteria, but that is still not quick enough to nav...
More

Excel VBA copy each worksheet to new workbook

This Excel tutorial explains how to copy each worksheet to new workbook in Excel VBA. You may also want to read: VBA Worksheets.Copy Method to copy worksheet VBA copy workbook or file Excel VBA copy each worksheet to new workbook Suppose you have a workbook that contains multiple worksheets, now you want to copy each worksheet to a new workbook. In this post, I will demonstrate how to do it in Macro. Sub cpyWS()     Application.ScreenUpdating = False      Application.DisplayAlerts ...
More

Excel calculate year of service with different methods

This Excel tutorial explains how to calculate year of service in Excel using different calculation methods. Excel calculate year of service Having worked for human resources field for some years in different companies, I have seen different systems / companies use different calculation methods to calculate year of service for annual leave entitlement. In this post, I want to summarize how to use Excel to calculate year of service using different methods to help HR professionals. Method 1 - ca...
More