+ Reply to Thread
Results 1 to 5 of 5

Speed up macro

  1. #1
    rn
    Guest

    Speed up macro

    Hi

    I am running a macro that copies a range from an open
    workbook and paste it to another open one. When I run
    the macro without vlookup function (in about 1000 cells
    on the paste sheet the macro completes instantly, but
    with it takes much longer. Is there any way I can speed
    up the macro without sacrificing what the function of the
    vlookup?

    Thanks.

  2. #2
    Bob Phillips
    Guest

    Re: Speed up macro

    It would help to see the code, but at the very least, pre-pend the code with

    Application.DisplayAlerts = False
    Application.Calculation = xlCalculateManual

    and appened this

    Application.Calculation = xlCalculateAutomatic
    Application.DisplayAlerts = True

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "rn" <[email protected]> wrote in message
    news:[email protected]...
    > Hi
    >
    > I am running a macro that copies a range from an open
    > workbook and paste it to another open one. When I run
    > the macro without vlookup function (in about 1000 cells
    > on the paste sheet the macro completes instantly, but
    > with it takes much longer. Is there any way I can speed
    > up the macro without sacrificing what the function of the
    > vlookup?
    >
    > Thanks.




  3. #3
    rn
    Guest

    Re: Speed up macro

    Hi Thanks a lot for the suggestions. I appended my code
    but I was hoping it would run much faster. The problem
    does not seem to be with the code but with the vlookup
    function. When I run the macro but deleting the vlookup
    fuction it completes nearly as fast as just a simple copy
    and paste.



    >-----Original Message-----
    >It would help to see the code, but at the very least,

    pre-pend the code with
    >
    > Application.DisplayAlerts = False
    > Application.Calculation = xlCalculateManual
    >
    >and appened this
    >
    > Application.Calculation = xlCalculateAutomatic
    > Application.DisplayAlerts = True
    >
    >--
    >
    >HTH
    >
    >RP
    >(remove nothere from the email address if mailing direct)
    >
    >
    >"rn" <[email protected]> wrote in

    message
    >news:[email protected]...
    >> Hi
    >>
    >> I am running a macro that copies a range from an open
    >> workbook and paste it to another open one. When I run
    >> the macro without vlookup function (in about 1000 cells
    >> on the paste sheet the macro completes instantly, but
    >> with it takes much longer. Is there any way I can

    speed
    >> up the macro without sacrificing what the function of

    the
    >> vlookup?
    >>
    >> Thanks.

    >
    >
    >.
    >


  4. #4
    Bob Phillips
    Guest

    Re: Speed up macro

    The time is probably taken by al the VLOOKUPs taking time to resolve. If the
    suggestions don't improve it, then because it is just a paste job, then
    there is probably no savings that can be made.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "rn" <[email protected]> wrote in message
    news:[email protected]...
    > Hi Thanks a lot for the suggestions. I appended my code
    > but I was hoping it would run much faster. The problem
    > does not seem to be with the code but with the vlookup
    > function. When I run the macro but deleting the vlookup
    > fuction it completes nearly as fast as just a simple copy
    > and paste.
    >
    >
    >
    > >-----Original Message-----
    > >It would help to see the code, but at the very least,

    > pre-pend the code with
    > >
    > > Application.DisplayAlerts = False
    > > Application.Calculation = xlCalculateManual
    > >
    > >and appened this
    > >
    > > Application.Calculation = xlCalculateAutomatic
    > > Application.DisplayAlerts = True
    > >
    > >--
    > >
    > >HTH
    > >
    > >RP
    > >(remove nothere from the email address if mailing direct)
    > >
    > >
    > >"rn" <[email protected]> wrote in

    > message
    > >news:[email protected]...
    > >> Hi
    > >>
    > >> I am running a macro that copies a range from an open
    > >> workbook and paste it to another open one. When I run
    > >> the macro without vlookup function (in about 1000 cells
    > >> on the paste sheet the macro completes instantly, but
    > >> with it takes much longer. Is there any way I can

    > speed
    > >> up the macro without sacrificing what the function of

    > the
    > >> vlookup?
    > >>
    > >> Thanks.

    > >
    > >
    > >.
    > >




  5. #5
    Forum Contributor
    Join Date
    02-15-2005
    Location
    Blackpool, UK
    Posts
    137
    Also try application.screenupdate = false, but remeber to turn it back on again!

+ Reply to Thread

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