Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default which is better?

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default which is better?

Hi Gregor

I would rather do it like this:

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

Regards,
Per

"Gregor" skrev i meddelelsen
...
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 320
Default which is better?

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

"Gregor" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"