VBA Tips
Date and time
- Examples of date and time formatting using the format function
- Number of days in a month (or last day of the month)
Formatting and text
- Check whether or not a string contains a defined value and return the position
- Convert to uppercase or lowercase (and check if a value is uppercase or lowercase)
- Format some of the characters inside a cell
- Remove unnecessary spaces
- Replace some of the values with others within a string
- Reverse a string
Generators and calculations
- Convert a hexadecimal color to a Color value
- Generate a random code
- Generate a random number
- Square root (and square)
UserForm and controls
Variables and arrays
- Check if a value exists in an array
- Reset or erase an array
- Search the position of a value in an array
- Sort an array
Various
- Disable events
- Perform an action depending on Excel’s version
- Stop a running macro
- Ternary operator
- Using ScreenUpdating to speed up the execution of a macro
- VBA code protection (obfuscator)
Worksheets and Workbooks
- Ban the selection of multiple cells
- Determining the number of the last row
- Display or hide a worksheet
- Force enabling of macros
- Hide tabs
- Prevent editing the name of a tab
- Preventing a file from being saved