Results 1 to 5 of 5

Deleting parameters to save running time?

Threaded View

aca Deleting parameters to save... 03-06-2012, 03:28 PM
Leith Ross Re: Deleting parameters to... 03-06-2012, 06:08 PM
abousetta Re: Deleting parameters to... 03-06-2012, 06:23 PM
aca Re: Deleting parameters to... 03-07-2012, 03:43 AM
abousetta Re: Deleting parameters to... 03-08-2012, 07:52 AM
  1. #1
    Forum Contributor
    Join Date
    08-04-2005
    Location
    Madrid, Spain
    MS-Off Ver
    2010
    Posts
    241

    Deleting parameters to save running time?

    I notice that some instructions in my macros can be shortened, thereby saving nanoseconds of running time (presumably !), and the end result of the operation is still the same.
    But is it so? Are there any drawbacks? is the time saved worth it, when I have to run many such instructions?
    Some instances:

    1)
    Range("C2").Select
    Selection.Copy
    shortened to
    Range("C2").Copy
    2)
    Range("C2").Select
    With Selection.Interior
            .Pattern = xlSolid
            .PatternColorIndex = xlAutomatic
            .Color = 65535
            .TintAndShade = 0
            .PatternTintAndShade = 0
        End With
    shortened to
    Range("C2").Interior.Color = 65535

    3)
    Cells.Find(What:="2", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
            xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
            False, SearchFormat:=False).Activate
    shortened to
    Cells.Find(What:="2", After:=ActiveCell, LookAt:=xlPart, searchOrder:=xlByColumns, SearchDirection:=xlNext).Activate
    Thanks for any enlightened answer.
    ACA
    Last edited by aca; 03-06-2012 at 03:32 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1