Here we show how VBA can be used to run custom functions – instead of using Excel formulae.
Screenshots
Section titled “Screenshots”
Custom Function - Example 1

Custom Function - Example 2
VBA Module Code – Separate Text
Section titled “VBA Module Code – Separate Text”Function separate_text(a As String) As StringApplication.VolatileDim i As IntegerDim s As String
For i = 1 To Len(a)s = Mid(a, i, 1)
If IsNumeric(s) = False Thenseparate_text = separate_text & s
End IfNext i
End FunctionVBA Module Code – Bonus
Section titled “VBA Module Code – Bonus”Function bonus(item, price)
If item >= 20 Thenbonus = item * price * 0.3End If
If item < 20 And item > 10 Thenbonus = item * price * 0.2End If
If item >= 1 And item < 11 Thenbonus = item * price * 0.1End If
End FunctionDownload
Section titled “Download”The full file can be downloaded here: