Tag Archives: VBA

Excel VBA Tips & Tricks

[adsense slot=”5402167102″ width=”468″]

Am consolidating here some commonly required Excel VBA snippets in an FAQ form.

How to find the last row in a Worksheet?

How to clear the clipboard after a copy/paste operation?

Why am I not able to copy a range?

If I get a Column number, how can I get the Column alphabet?

Is there something else you would like me to add here? Just leave a comment.

Excel Default Colors for VBA

This is a handy reference list for the default Workbook.Colors list in excel.

excel-colors-vba

In case you are interested in generating the same list, here is the code. ‘Colors’ here refer to the sheet name and you may have to replace it with a relevant value (say, Sheet1).

And wait, SplitColors is not a built in function. This is a small piece of code that takes in a Long color and returns 3 hex strings. Basically, a long to hex converter for a color. That one follows.

This is not a tutorial on how to use ColorIndex to set colors using Excel VBA. For details on that, take a look at this.