Take the absolute value of a number with the VBA Abs function. The VBA Abs function will return the absolute value of a number or variable in your macro.
This VBA tutorial shows you how to take the square root of a number in VBA using the Sqr function. The VBA Sqr function will return the square root of a number.
We've combined each of our comprehensive wellsrPRO VBA training reference guides into a single bundle with over 180 tips and macros covering the 100 most important topics in VBA.
Tell me more
Use VBA to paste values in Excel instead of formulas. Bind this VBA macro to the Ctrl+Shift+V keyboard shortcut to make pasting values even faster.
Use VBA to find out who has your Excel file locked for editing. Save this macro to your spreadsheet and it will tell you when someone else has the file open.
In VBA, you can stop your macro execution manually with the Esc key or by pressing Ctrl+Break. Remember this the next time you need to exit an infinite loop.
Use Excel to record your mouse clicks and cursor movements and convert them directly into VBA macros so you can easily automate complex tasks, like copying data from a website.
Use the VBA Application.Wait method to pause your macro for a specific amount of time. Application.Wait lets you delay your macro by a fixed number of seconds.
You can check Application.CalculationState if you want to wait until the formulas on your sheet are done calculating before resuming your VBA macro.
The VBA Mod operator is the VBA equivalent of the Excel MOD function. You use the VBA modulo operator to return the remainder after dividing two numbers.
Change negative numbers to positive numbers and positive numbers to negative numbers in Excel by using VBA. These macros reverse the sign of cells in Excel.
Use the VBA Sleep function to add a macro time delay. The Sleep function is better than Application.Wait because it lets you pause macros for milliseconds.
subscribe via RSS
Join our free 90-day VBA Training Program and start building your reputation as an office innovator.