Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 12-01-2015, 04:50 PM
Graham Griggs Graham Griggs is offline Applying a formula from a checkbox in VBA Windows 8 Applying a formula from a checkbox in VBA Office 2013
Novice
 
Join Date: Dec 2015
Posts: 11
Graham Griggs is on a distinguished road
Default just a comment

Thanks also NoSparks

I hadnt realised the xlFillDefault was not actually always the default !

But, looking at the thread jap, you puzzle me why are you doing this in VBA?

Just use Excel, then the errors are given you in real time.

If you want to use it repeatedly then write it in Excel and just load the inputs and read the outputs using VBA


Not only is it much easier to debug, it also runs much faster (Excel native calculation is much faster than doing exactly the same thing in VBA)

If you set a formula in Excel it "works out what the formula means", saves the result in Excel native language (which takes while) and calculates the answer. You then save it and it recalculates using new input values in the blink of an eye.

If you use VBA to set a formula, first it must hand over to the Excel bit (called the "command parser") to work out what your formula means, and then it must calculate the value for an answer, it cant save it because it doesnt know what vba is going to pass it.Probably doesnt make much difference if you are only going to do it once, but anything that is proessing repetitively is going to be slow.


Also logical debugging is instantaneous - it will immeditely give you #error, #value etc, rather than having to run your vba through to the suspect point

Also testing is easy, you can manually enter all of the posible entries and check that they work
every time I see .formulaArray I know it is going to be slow and unreliable, even if you get it working in the first place
Reply With Quote
 

Tags
check box, iferror, index



Similar Threads
Thread Thread Starter Forum Replies Last Post
Applying styles dynamically? arkofcovenant Mail Merge 1 05-08-2015 06:02 AM
applying a style in a new document lihin Word 1 12-13-2012 05:22 AM
Applying a formula from a checkbox in VBA Applying Header to certain pages chloe.eloise Word 2 05-16-2011 12:13 AM
Help applying different margins to different pages kthomp Word 0 06-18-2010 11:37 AM
Applying And Removing Letterhead skoz55 Word 0 08-06-2009 10:22 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:41 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft