which is better?

G

Gregor

From a performance stand point, which of these is better:

Range("A6:D6").Font.Bold = True
Range("A6:D6").HorizontalAlignment = xlCenter

or

Range("6:6").Font.Bold = True
Range("6:6").HorizontalAlignment = xlCenter

(There will never be any data beyond column D).

I'm using 2007 but keeping the workbook in computability mode.


Thanks
-Gregor
 
P

Per Jessen

Hi Gregor

I would rather do it like this:

With Range("A6:D6")
.Font.Bold = True
.HorizontalAlignment = xlCenter
End With

Regards,
Per
 
B

Bob Umlas, Excel MVP

I don't think there's a difference, but THIS would be better still:
With Range("A6:D6")
.Font.Bold = True
.HorizontalAlignment = xlCenter
End With

Bob Umlas
Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top