Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default Best Practice

Since I found out yo may write
[Sheet2!A1:b2].value
instead of :
Worksheets("Sheet2").Range("A1:B2").Value

I would like to know wether this is bad practice or just a performance issue

TIA

--
AP


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Best Practice

Using the [] method is slower than second method. I always use
the second method, though that is a matter of personal
preference.


"Ardus Petus" wrote in message
...
Since I found out yo may write
[Sheet2!A1:b2].value
instead of :
Worksheets("Sheet2").Range("A1:B2").Value

I would like to know wether this is bad practice or just a
performance issue

TIA

--
AP




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default Best Practice

I thought VBA was compiled before execution.
If true, how come one method is faster than the other?

TIA

--
AP

"Chip Pearson" a écrit dans le message de
...
Using the [] method is slower than second method. I always use
the second method, though that is a matter of personal
preference.


"Ardus Petus" wrote in message
...
Since I found out yo may write
[Sheet2!A1:b2].value
instead of :
Worksheets("Sheet2").Range("A1:B2").Value

I would like to know wether this is bad practice or just a
performance issue

TIA

--
AP






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Best Practice

The contents of the [] characters are evaluated at run time.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Ardus Petus" wrote in message
...
I thought VBA was compiled before execution.
If true, how come one method is faster than the other?

TIA

--
AP

"Chip Pearson" a écrit dans le message de
...
Using the [] method is slower than second method. I always use
the second method, though that is a matter of personal
preference.


"Ardus Petus" wrote in message
...
Since I found out yo may write
[Sheet2!A1:b2].value
instead of :
Worksheets("Sheet2").Range("A1:B2").Value

I would like to know wether this is bad practice or just a
performance issue

TIA

--
AP








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default Best Practice

Thanks for that definite response!

--
AP

"Chip Pearson" a écrit dans le message de
...
The contents of the [] characters are evaluated at run time.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Ardus Petus" wrote in message
...
I thought VBA was compiled before execution.
If true, how come one method is faster than the other?

TIA

--
AP

"Chip Pearson" a écrit dans le message de
...
Using the [] method is slower than second method. I always use
the second method, though that is a matter of personal
preference.


"Ardus Petus" wrote in message
...
Since I found out yo may write
[Sheet2!A1:b2].value
instead of :
Worksheets("Sheet2").Range("A1:B2").Value

I would like to know wether this is bad practice or just a
performance issue

TIA

--
AP












  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Best Practice

Harlan always jumps on me when I do it.

Why am I not surprised?


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Don Guillett" wrote in message
...
I sometimes use [] because of brevity. Harlan always jumps on me
when I do it.

--
Don Guillett
SalesAid Software

"Chip Pearson" wrote in message
...
Using the [] method is slower than second method. I always use
the second method, though that is a matter of personal
preference.


"Ardus Petus" wrote in message
...
Since I found out yo may write
[Sheet2!A1:b2].value
instead of :
Worksheets("Sheet2").Range("A1:B2").Value

I would like to know wether this is bad practice or just a
performance issue

TIA

--
AP








  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Best Practice


Following conclusions reached on the use [], does the same apply to
using
(for example) [Sum(A1:A100)] instead of
Application.Sum(Range("A1:A100") or
WorkSheetFunction.Sum(Range("A1:A100")?

Thanks

David


--
davidm
------------------------------------------------------------------------
davidm's Profile: http://www.excelforum.com/member.php...o&userid=20645
View this thread: http://www.excelforum.com/showthread...hreadid=514190

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Best Practice CWillis Excel Discussion (Misc queries) 2 June 27th 06 04:40 PM
SQL practice with Excel? J_J[_2_] Excel Programming 4 September 25th 05 05:55 AM
best practice? hsibbs Excel Discussion (Misc queries) 7 June 17th 05 04:11 AM
Practice Files Mike[_63_] Excel Programming 1 December 8th 03 08:36 PM
Need Some Practice Linc Excel Programming 3 November 26th 03 01:36 PM


All times are GMT +1. The time now is 07:02 PM.

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

About Us

"It's about Microsoft Excel"