D
Dan
I have a macro that puts data into a sheet and sets the font to bold and
color to yellow. It looks like this:
Cells(x, 7).Select
Selection.Font.Bold = True
Selection.Interior.ColorIndex = 6
I was reading some websites that say this is not efficient, that I should
use with:
example:
With Range("A1")
.Font.Bold = True
.Interior.ColorIndex = 6
End With
Since my code is in a loop I use Cells(x,7). How do I format the Range
object to use a variable instead of "A1"? I tried Range(Cells(x,7)) but got
an error.
Dan
color to yellow. It looks like this:
Cells(x, 7).Select
Selection.Font.Bold = True
Selection.Interior.ColorIndex = 6
I was reading some websites that say this is not efficient, that I should
use with:
example:
With Range("A1")
.Font.Bold = True
.Interior.ColorIndex = 6
End With
Since my code is in a loop I use Cells(x,7). How do I format the Range
object to use a variable instead of "A1"? I tried Range(Cells(x,7)) but got
an error.
Dan