Sometimes it is useful to be able to generate random numbers in Excel that are limited to a certain range. Maybe you have an "employee of the month" contest and you just can't pick one. Assign a number to each employee, enter the first and last numbers and run the macro. And who said decision making was difficult! Or, on the serious side you could be doing some testing … [Read more...]
Run Macro Automatically on Open
Insert your macro code into a module, start with Sub Auto_Open(). Enter whatever commands you wish to have executed on opening the file and end with End Sub. This will make Excel run macro on open and is the quickest way to run a macro automatically on opening an excel workbook. Excel Run Macro on Open To automatically run a macro when you open excel, follow these simple … [Read more...]
Remove Hyperlinks
Whenever copying a list into Excel from the internet, you run the risk of pasting in unwanted hyperlinks. Sure, you could paste special as text, but sometimes it's format was just fine the way it was. With this macro, just select all the cells with hyperlinks (even those without hyperlinks are ok to be selected) and run the macro. In a couple seconds all links are gone and your … [Read more...]
Print Custom Views
Custom views are a useful way to set, all sorts of ways to view your data, including print areas. You can set up a sheet to have several custom views set to print different areas of your worksheet. It would be nice though to be able to set a macro to automatically print the pre-defined print area for you. Copy the code below into your Visual Basic Editor once for each custom … [Read more...]
Negative Cell Value
This macro takes whatever values are in a selected range of cells and multiplies them by -1. This is especially useful for accountants who might get a list of client data as absolute values. In accounting world, however, the debits and credits might need to have a sign reversed. With this macro, just select the cells you want reversed, and run the macro. Copy all of the code … [Read more...]