Posts

Showing posts with the label VBA

udiMagic v11 Release 2.1

Template Modifications 1. Master-StockItemMaster.xls a. If the group-name field is kept blank under the "Default Sales Ledger Allocation" section, then the default group is taken as "Sales Accounts" b. If the group-name field is kept blank under the "Default Purchase Ledger Allocation" section, then the default group is  taken as "Purchase Accounts" 2. Vouchers-V11-Stock-Journal.xls New fields / columns have been kept for specifying the "Additional Cost Ledger" details. Other Fixes 1. Char 160 is replaced by char 32, but the new char 32 is inserted at the  wrong position. This has now been rectified. 2. udiMagic now supports VBA macro functions with upto 20 parameters. Earlier it was limited to 8 parameters.

VBA Check if Sheet exists

In certain Excel templates, we use a sheet for specifying some Settings. Generally, this sheet is named as SETTINGS. However, at times you may forget to include the Settings sheet. Here's the macro code to check for the Settings sheet and display a message if it is NOT found. 'Check if Sheet exists '===================== Dim sh As Worksheet, flg As Boolean For Each sh In Worksheets If sh.Name Like "Settings*" Then flg = True: Exit For Next If flg = True Then 'MsgBox "Found!" Else MsgBox "Error: Settings Sheet NOT Found! " +chr(13)+chr(13)+"A sheet named SETTINGS must exist in Excel file"+chr(13)+"Terminating application" Application.Quit End If

VBA Macro - Speed up

Excel to Tally If you have Excel VBA macro code (using with UDIMagic) that runs slow, the chances are it's caused by Excel having to recalculate at each line of code. The code below shown how we can switch calculation into manual, run some code, then put it back how it was. Sub GoToManual() Dim xlCalc As XlCalculation xlCalc = Application.Calculation Application.Calculation = xlCalculationManual On Error GoTo CalcBack 'YOUR CODE Application.Calculation = xlCalc Exit Sub CalcBack: Application.Calculation = xlCalc End Sub