Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Gracie Hughes   on Mar 04 In MS Office Category.

  
Question Answered By: Sydney Thompson   on Mar 04

I don't like the idea of putting a value into a cell in order to get a
formula to calculate something and then to read it back with VBA. I would
not have confidence that the calculation would be done immediately (i.e. in
time for the statement that reads it). Indeed, the worksheet's calculation
might be set to "manual" which would likely cause the calculation not to be
done at all until you hit F9.

To ensure the sheet is up-to-date you would really need to get VBA to order
a sheet recalculation before reading the result cell.

As well as being a bit uncertain, this has got to be a slow way of doing it.
You're relying on the control flow moving from the VBA to Excel and back
again.

As well as this, you've now got an activity that is integral to your VBA,
but is not visible when reading your code - i.e. you also need comments to
explain what Excel is doing.

So, I see "cons". Unfortunately, I can't see any "pros" - apart from the
fact that you're comfortable with it, which is always a big "pro" in itself.

Share: 

 

This Question has 26 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Worksheet functions in VBA Or get search suggestion and latest updates.


Tagged: