This is my code:

```
Dim var As string
var = Range("B1").Value
Range("").Interior.ColorIndex = 5
```

Is it possible to define the last line like this in some way, and if so, how?:

```
Range("var").interior.Colorindex= 5
```

I want the range to be define by a value in a cell, but I am stuck here because I am not sure how to proceed. I need to be able to write individual cell numbers in cell B1 i.e A1, A2, B6 etc and use them to define the range in the code above. Thanks in advance.

`var`

is variable holds value/data of cell`B1`

, if U wanna to color same cell`B1`

then write,,`Dim rng As Range Set rng = Range("B1") rng.Interior.ColorIndex = 5`

☺ Or you may use another cell in place of`B1`

A1, A2, B6 etc) and have his code use that for the VBA`Range`

reference.3more comments