Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default Macro - set calc off

Some of my macros seem to be slowed down by having to calculate after each
operation and this is not necessary. So, initially, I want to disable calc
and do it only once at the end. What is the best macro command for this?

Thanks,
Grace


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Macro - set calc off

Grace,

At the beginning of the procedure, use

Application.Calculation = xlCalculationManual

At the end of the procedure, use

Application.Calculation = xlCalculationAutomatic



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



"Grace" wrote in message
...
Some of my macros seem to be slowed down by having to calculate

after each
operation and this is not necessary. So, initially, I want to

disable calc
and do it only once at the end. What is the best macro command

for this?

Thanks,
Grace




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default Macro - set calc off

Grace, one way to get the required statements is just to record a macro of
the action.

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"Grace" wrote in message
...
Some of my macros seem to be slowed down by having to calculate after each
operation and this is not necessary. So, initially, I want to disable

calc
and do it only once at the end. What is the best macro command for this?

Thanks,
Grace




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default Macro - set calc off

Hey Bob,

I do know this. In fact, this is how I create most of my code! In this
case, I got

With Application
.Calculation = xlManual
.MaxChange = 0.001
End With
ActiveWorkbook.PrecisionAsDisplayed = False

is this the same thing as the one-liner Chip just advised?

The one thing that is really confusing me is trying to record relative
references. I know how to set it, now, but it still doesn't seem to work as
I would hope, even with that option selected. For example, let's say I
select a block of cells but want to expand it by six columns to the right.
When I record, it shows me something like f16 going to L16, but this does
not work the next time, when my block is not ending in cell f16. Can I get
it to record this kind of thing? By the way, someone kindly tell me what
the VB command is for expanding a selected range by six columns to the
right, in case the recording doesn't work.

Thanks,
Grace

"Bob Flanagan" wrote in message
...
Grace, one way to get the required statements is just to record a macro of
the action.

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"Grace" wrote in message
...
Some of my macros seem to be slowed down by having to calculate after

each
operation and this is not necessary. So, initially, I want to disable

calc
and do it only once at the end. What is the best macro command for

this?

Thanks,
Grace






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Macro - set calc off

set rng = selection.Resize(,6)

--
Regards,
Tom Ogilvy

"Grace" wrote in message
...
Hey Bob,

I do know this. In fact, this is how I create most of my code! In this
case, I got

With Application
.Calculation = xlManual
.MaxChange = 0.001
End With
ActiveWorkbook.PrecisionAsDisplayed = False

is this the same thing as the one-liner Chip just advised?

The one thing that is really confusing me is trying to record relative
references. I know how to set it, now, but it still doesn't seem to work

as
I would hope, even with that option selected. For example, let's say I
select a block of cells but want to expand it by six columns to the right.
When I record, it shows me something like f16 going to L16, but this does
not work the next time, when my block is not ending in cell f16. Can I

get
it to record this kind of thing? By the way, someone kindly tell me what
the VB command is for expanding a selected range by six columns to the
right, in case the recording doesn't work.

Thanks,
Grace

"Bob Flanagan" wrote in message
...
Grace, one way to get the required statements is just to record a macro

of
the action.

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"Grace" wrote in message
...
Some of my macros seem to be slowed down by having to calculate after

each
operation and this is not necessary. So, initially, I want to disable

calc
and do it only once at the end. What is the best macro command for

this?

Thanks,
Grace










  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default Macro - set calc off

Thanks!

Grace

"Tom Ogilvy" wrote in message
...
set rng = selection.Resize(,6)

--
Regards,
Tom Ogilvy

"Grace" wrote in message
...
Hey Bob,

I do know this. In fact, this is how I create most of my code! In this
case, I got

With Application
.Calculation = xlManual
.MaxChange = 0.001
End With
ActiveWorkbook.PrecisionAsDisplayed = False

is this the same thing as the one-liner Chip just advised?

The one thing that is really confusing me is trying to record relative
references. I know how to set it, now, but it still doesn't seem to

work
as
I would hope, even with that option selected. For example, let's say I
select a block of cells but want to expand it by six columns to the

right.
When I record, it shows me something like f16 going to L16, but this

does
not work the next time, when my block is not ending in cell f16. Can I

get
it to record this kind of thing? By the way, someone kindly tell me

what
the VB command is for expanding a selected range by six columns to the
right, in case the recording doesn't work.

Thanks,
Grace

"Bob Flanagan" wrote in message
...
Grace, one way to get the required statements is just to record a

macro
of
the action.

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"Grace" wrote in message
...
Some of my macros seem to be slowed down by having to calculate

after
each
operation and this is not necessary. So, initially, I want to

disable
calc
and do it only once at the end. What is the best macro command for

this?

Thanks,
Grace










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
MACRO can I calc just one line? MrDave Excel Discussion (Misc queries) 1 August 9th 09 11:15 AM
2Q:Indirect worksheet selection in macro, Calc off for specific sh seed Excel Discussion (Misc queries) 1 December 30th 08 09:11 PM
auto calc on, but have to edit (f2) cells to force re-calc..help! Curt Excel Worksheet Functions 3 February 13th 06 06:05 PM
Excel Macro - Calc to last row problem mickw Excel Programming 7 June 10th 04 05:46 PM
Macro to calc an intersection No Name Excel Programming 2 May 21st 04 01:38 AM


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