Where to begin learning Visual Basic For Applications (VBA) ?
The simplest macro in Visual Basic for Applications (VBA) in Microsoft Excel is as per the code below:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | Option ExplicitSub Hello_World()'---------------------------------------------------------------------------------------' Procedure : Hello_World' Author : vsmathur-onms' Date : 17/10/2019' Purpose :'---------------------------------------------------------------------------------------' On Error GoTo Hello_World_Error MsgBox "Hello World !!", vbOKOnlyHello_World_Exit: On Error GoTo 0 Exit SubHello_World_Error: MsgBox "Error " & Err.Number & " on Line # " & Erl & " (" & Err.Description & ") in procedure Hello_World of Module m_HelloWorld" Resume Hello_World_Exit End Sub |

Comments
Post a Comment