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

dear all,

I have the following problem. I have an excel file with a
lot of Vlookup's. I also run in VBA-macro in this excel
file. This macro take a long time because these vlookup's.
When I calculate my excel manually (adaption in tools-
options-calculations-manual) then my macro is much faster.
Do you have an idea how I can take this into account in my
macro? Otherwise I always have to click on F9 and run my
macro.

Thanks for any response,
Jan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default VBA calculate manually

Hi Jan

Insert into your macro

Application.Calculation = xlManual
' your dramatic actions here, and
Application.Calculation = xlAutomatic

HTH. Best wishes Harald

"Jan" skrev i melding
...
dear all,

I have the following problem. I have an excel file with a
lot of Vlookup's. I also run in VBA-macro in this excel
file. This macro take a long time because these vlookup's.
When I calculate my excel manually (adaption in tools-
options-calculations-manual) then my macro is much faster.
Do you have an idea how I can take this into account in my
macro? Otherwise I always have to click on F9 and run my
macro.

Thanks for any response,
Jan



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default VBA calculate manually

Set the calculation in the macro using

Private Sub MakeBig Change()
On Error Goto ErrorHandler

application.caculation = xlManual
'Do that voodoo that you do

application.calculation = xlAutomatic

exit sub
ErrorHandler:
application.calculation = xlAutomatic
end sub

I highly recommend an error handler any time you change an application level
setting such as calculation or EnableEvents, to reset the system when
something crashes, because if you do enough of this stuff eventually
something will crash.


"Jan" wrote:

dear all,

I have the following problem. I have an excel file with a
lot of Vlookup's. I also run in VBA-macro in this excel
file. This macro take a long time because these vlookup's.
When I calculate my excel manually (adaption in tools-
options-calculations-manual) then my macro is much faster.
Do you have an idea how I can take this into account in my
macro? Otherwise I always have to click on F9 and run my
macro.

Thanks for any response,
Jan

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
How do I calculate the interest payment manually (without using IP Grd Excel Worksheet Functions 4 April 2nd 07 11:45 PM
How do I manually calculate this formula PV(P3/1200,Q3,-N3*M3/100 Claressa Excel Worksheet Functions 2 December 9th 05 06:27 PM
is it possible to use F9 to manually calculate in a single sheet or single workbook? Hersbt Excel Discussion (Misc queries) 2 December 29th 04 04:42 PM
Single Sheet - Calculate Manually Charles Williams Excel Programming 1 July 10th 03 05:37 PM
Single Sheet - Calculate Manually Mark Bigelow[_2_] Excel Programming 0 July 8th 03 09:21 PM


All times are GMT +1. The time now is 08:19 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"