Link to home
Start Free TrialLog in
Avatar of Mcnubbin
Mcnubbin

asked on

VBA-Excel Worksheet_calculate targeting a specific cell

Hello, I was wondering how i can use the Worksheet_Calculate function to target a specific cell or range as opposed to the entire sheet.  My VBA experience is nill so detailed help would be greatly appreciated. Thanks!
Avatar of geekspeaknow
geekspeaknow
Flag of United States of America image

Couldn't you just put something in your own code instead of using Worksheet_Calculate?  Something like:

Range("A1:B18").Select

Avatar of spattewar
spattewar

This event occurs only after the sheet calculation happens and hence if you want to just calculate a specific range of cells or only one sheet you can use the following options in your code and not in this event.

<worksheet>.calculate to calculate only a specific sheet
Range.calculate to calculate a specific range of ccells or cell
Application.Calculate to calculate the entire workbook.

$wapnil
Avatar of Mcnubbin

ASKER

I'm sorry, I don't quite understand, I'm trying to trigger a macro whenever a specific cell changes. This cell imports data from an RTD Formula and so updates live.  The problem is that there are several other cells also importing data, so each second, the cell I am looking at may not update however the other cells likely will, thus triggering my macro and the worksheet_calculate function permanently, causing enormous CPU usage.
ASKER CERTIFIED SOLUTION
Avatar of spattewar
spattewar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you were only interested in one cell, an easy cheat would be to have a hidden sheet with one cell linked to your cell of interest and use that sheet's calculate event.
Forced accept.

Computer101
EE Admin