Excel VBA OFFSET Property for Range

Excel VBA OFFSET Property for Range
This Excel VBA tutorial explains how to use Excel VBA OFFSET property, and explain difference between VBA OFFSET Property and worksheet OFFSET Function. Excel VBA OFFSET Property Excel VBA OFFSET property returns the Range object which is number of rows and columns away from a specific range. You can specify to shift up, down, left or right from a cell. For example, if column A contains emplo...
Read More

Excel VBA delete worksheet based on worksheet name

Excel VBA delete worksheet based on worksheet name
Solution to delete worksheet based on worksheet name I am providing the solution for the "Deluxe-Plus" version in the below code To determine which worksheet is to delete, create an array called delWS(), and then loop through all the worksheet name to find the worksheet name that contains "DELETE" or "OLD". If (InStr(WS.Name, "DELETE") <> 0 Or InStr(WS.Name, "OLD") <> 0) And ...
Read More

Excel VBA change cell range to array

Excel VBA change cell range to array
  Solution to change cell range to array In the below solution, I have made a Sub to define array (defineArray), a Sub to delete worksheet(delWS), a Sub to move worksheet(moveWS) First, I define an array at Module level, so that all Sub within the Module can access the array. In Sub defineArray(), I put all the items from Range A4 to the last row of column A into wsArray() In...
Read More

Excel VBA Check cell value and cell value above

Excel VBA Check cell value and cell value above
This tutorial provides a solution to check the Excel cell value and the cell value above in Excel worksheet using VBA. Check cell value and cell value above This was originally a question posted in Microsoft Community. I extract it to illustrate an example how to check Excel cell value and cell value above. Question Given a range of 12 cells in a row filled with only 0's and 1's... Would ...
Read More

Excel DATEDIF Function to calculate date difference

Excel DATEDIF Function to calculate date difference
This tutorial explains how to use Excel DATEDIF Function to calculate date difference (difference between two dates) in complete year, month or day. You may also want to read: Access Excel VBA day month year difference between two dates Excel DATEDIF Function DATEDIF function stands for "Date Difference". It calculates the difference between two dates in complete year, month or day. Note t...
Read More

Excel VBA For Loop / For…Next

Excel VBA For Loop / For…Next
This tutorial explains how to use For Loop (For...Next Loop) to perform iteration in Excel VBA. What is Loop? Loop is repeating a set of actions. When you listen to a song repeatedly, it is said you are looping the song. In VBA, there are different kinds of loop methods, they mainly differ in the way that how the loop is triggered and ended. What is For Loop? (For...Next Loop) For Loop (F...
Read More

Change font color and format in Visual Basics Editor VBE

Change font color and format in Visual Basics Editor VBE
This tutorial explains how to change font color and formats in Visual Basics Editor (VBE) to make your VBA code more readable. This article is suitable for Excel and Access. Change the VBE font color and format, why? Depending on the color and brightness setting of your monitor, the default font color in VBE (Visual Basic Editor) is not always easy to read. It is possible to change the VBE fon...
Read More

Custom VBA Excel Access Networkdays Function

Custom VBA Excel Access Networkdays Function
This tutorial explains how to create a custom Excel Access Networkdays Function to simulate Excel Networkdays Function, exclude holiday and weekend Why do we need Access Networkdays Function? As of Access 2013 version, there is no Access Networkdays Function available, the function is only available in Excel all versions. In Excel , Networkdays Function is used to calculate the number of "net...
Read More