VBA range set value

The range object in VBA represents a range of cells on a worksheet. It can consist of multiple cells, as well as a…

Posted On

VBA Save as

In order to save a workbook in VBA, use Alt + F11 and enter the following code. Sub SaveWorkbook()     ActiveWorkbook.Save End Sub…

Posted On

VBA find last column

In this lesson, I presented a few ways to get the last column number. The first methods are easy, but then the code…

Posted On

VBA sort range

In order to sort data inside a range in VBA, you have to use the following code. Sub Sort() Range(“A1:A10”).Sort key1:=Range(“A1”), order1:=xlAscending, Header:=xlNo…

Posted On

Check cell color in VBA

Each color in Excel has its index. You can get both background and font color with a shortcode. Let’s use the following example…

Posted On