Calculate a Range

charlie79

Board Regular
Joined
Feb 27, 2002
Messages
97
I want to write vba code to calculate a specific range of cells instead of the whole sheet. What I have done so far is selected the range in xl, and in the name box given that range a name. I then am trying to reference that range name in my code. But it doesn't seem to be calculating the whole range? Should I be creating a range object in my code and using it to reference the cells. Or maybe it's a problem with my code:
Range("SimAvg").Calculate
"SimAvg" being the range name I gave the cells in xl. I'm using xl2k.
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Are you sure you set Calculation to Manual from Tools_Options_Calculation? (assume you dont want auto calculation according to your explanations)
 
Upvote 0
Yes, I actually have it in my code to manual calc. This spreadsheet contains a lot of formulas and makes a lot of calls to another app server, which would cause calcs everytime a call is made... ?
 
Upvote 0
I realize I could hard code it that way, but I like to stay away from that. My question I guess is, can I reference a Cell Range I created in xl or do I have to create a Range object in my code?
 
Upvote 0
Maybe you need to reference the worksheet:

Worksheets(Range("simavg").Worksheet.Name).Range("SimAvg").Calculate

Does

Worksheets(Range("simavg").Worksheet.Name).Range("SimAvg").select

Take you to the appropriate range?

_________________
Cheers,<font size=+2><font color="red"> Nate<font color="blue">O</font></font></font>
This message was edited by NateO on 2002-03-19 10:39
 
Upvote 0

Forum statistics

Threads
1,213,534
Messages
6,114,188
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top