Category Archives: VBA

Python for VBA users – 3

In the previous post in this series I looked at translating a routine to solve quadratic equations from VBA to Python.  Using the same process I have also created Python code to solve Cubic equations.  The only added difficulty for the … Continue reading

Posted in Excel, Link to Python, Maths, UDFs, VBA | Tagged , , , , , , | 2 Comments

Python for VBA users – 2

This post will look in more detail at translating the VBA Quadratic function (described in Python for VBA users – 1) into a Python function, linked to Excel via PyXll.  For the purposes of this exercise I created a new Python … Continue reading

Posted in Excel, Link to Python, NumPy and SciPy, UDFs, VBA | Tagged , , , , , , | 11 Comments

Commenting a block of code in VBA

One way is to manually place an apostrophe at the start of every line in the block. A much easier way (I just found out today) is: Go to View-Toolbars-Customise Select the Command tab Select the Edit Category on the … Continue reading

Posted in Excel, VBA | Tagged , , | 9 Comments

Python for VBA users – 1

Following my recent posts on some preliminary experimentation with linking Excel to Python, this will be the first of a more structured series, mainly as a reminder to myself of lessons learnt on the way, but also I hope of … Continue reading

Posted in Excel, Link to Python, UDFs, VBA | Tagged , , , , , | 2 Comments

Arrays vs Collections vs Dictionary Objects (and Dictionary help)

A recent comment by Lori Miller at Daily Dose of Excel suggested that (for the particular application being discussed) the VBA Collection object was quicker than using scripting dictionaries.  Since I hardly ever use collections (other than the built-in ones), and … Continue reading

Posted in Arrays, Excel, VBA | Tagged , , , , | 7 Comments