A Procedure can be Sub, Function or Property Procedure. Private Sub ListProcedures (strName As String, Optional blnWithParentInfo = False) 'Microsoft Visual Basic for Applications Extensibility 5. In fact, in this Excel VBA tutorial alone, I explain 9 different ways in which you can execute a Sub procedure. or its equivalent. Then it creates a list with all the Excel files that may contain VBA code (i. 3 Ways to Call a Private Sub from Another Module When a procedure requires a variable, subscribe to our VBA Insiders email series using the form below. To call a Sub procedure from another procedure, type the name of the procedure and include values for any required arguments. You can use the Call keyword when you call a Sub procedure,. A vba procedure is usually of two types, a sub procedure or a function. 0 Thread(s) Re: VB Function vs Sub procedure vs Gosub Norie. As an application developer, most of the time you'll be executing stored procedure programmatically. Customizing Worksheets by Using the Visual Basic for Applications Toolkit in Oracle® Hyperion Smart View for Office, Fusion Edition 11. Each time the procedure is called, its statements are executed, starting with the first executable statement after the Sub statement and ending with the first End Sub, Exit Sub, or Return statement encountered. NET: Demo on FreeVBCode. Press F8 and look at the Watches pane. To cause it to bark we could write Dog. I have created an addin from a sub() that I wrote in vba. I'd like to think that I am decent at VB but while I was learning javascript the other day I found something that seemed awesome and now I can't figure out how to do it in VB. If a sub procedure doesn't receive any arguments, its Sub statement must include an empty parenthesis(). Provide Excel tutorials, tips and free VBA source code, including custom VBA Function, Sub Procedure. Custom functions, like macros, use the Visual Basic for Applications (VBA) programming language. Excel VBA checks this for i = 1, i = 2, i = 3, i = 4 until i = number. How to Create Sub Procedure or Function Procedure A Sub procedure is a series of Visual Basic statements that start with the Sub and end with End Sub. Let's take a look at some of the differences between the two and when they should be used. NOTE : I’m going to use the terms sub, function and procedure interchangeably. To run a Sub procedure or event procedure written in Visual Basic, create a Function procedure that calls the Sub procedure or event procedure. You invoke a procedure from some other place in the code. In this example we generate the infamous, "Hello World!" string through use of a sub procedure (frequently. After the call is finished, control returns to the statement that called the procedure. In VB an action that an object can perform is referred to as a method. The records returned from the Stored Procedure will be loaded into the DataTable using ADO. VBA Dictionary. NET using VB. A function is similar to a sub procedure, however, there is one major difference. Anthony Sun is an Excel Consultant and data analyst specialized in Excel programming and database programming. You can pass arguments to the Sub procedure but the only limitation with the sub procedure is that it does not return any value. Is there anyone who knows what to do for this???. Sub Procedure - The most commonly used procedure is the Sub. What Is A Procedure: Excel VBA Function Procedures Vs. Sheets("Sheet1"). However a Dog is capable of more than barking, for example we could have Dog. Sub procedures are usually used to accept input from the user, display information, print information, manipulate properties or perform some other tasks. Event Procedure in VB. However, the Sub procedure does not. Writing To A Range Using VBA Posted on December 4, 2006 January 19, 2017 by John Walkenbach If you need to use a VBA procedure to write values to a range, most people would probably create a loop and write the values one cell at a time. End Sub where SubProcedureNme is the name you give to the Sub procedure, argumentList represents the argument list that is passed to the Sub procedure when it is called (multiple arguments are separated by commas), statements are a group of statements to be executed within the Sub procedure, and Exit Sub is a statement that provides an. Add the subroutine. net , datagridview in vb. This example teaches you how to run code from a module. Navigate to the sub procedure that you want to work with in the Visual Basic Editor. A Sub procedure is a block of code that is executed in response to an event. Insert the cursor outside of the Button1 sub. Function procedure 3. NET tutorial-Learn VB. Range("b4"). The following table describes the scope in detail. This lesson assumes that you can navigate the Visual Basic IDE, and create a simple project with which to test code. Does your Recordset return -1 for its RecordCount property? If yes, this article will be able to help you and explain the cause and fixes. Add the 'Exit Sub' command in the sub procedure where you want to exit a certain block of code. And we can call a procedure from either a procedure or function. In fact, in this Excel VBA tutorial alone, I explain 9 different ways in which you can execute a Sub procedure. In this example we generate the infamous, "Hello World!" string through use of a sub procedure (frequently. Value End Sub VBA ComboBox Default Values in Excel. VBA’s Standard toolbar; When you toggle the Design Mode button back to “on”, then the Document_RunModeEntered event fires, and any code in this Sub will execute! No more closing and opening your document just to test! You can paste the Sub below into your VBA project and give it a go. The "More Information" section of this article describes each scope in detail. Sleep Function: Sleep is a windows function and not a VBA Function, but you can still use this function in VBA code by calling the windows Sleep API. OnTime EarliestTime:=RunWhen, Procedure:=cRunWhat, Schedule:=False. A VBA procedure is defined by a beginning declaration statement (Sub or Function) and an ending statement with statements in between. Having issues with this, its my second day at new job and I'm still newb to databases and really need some help. 3 Ways to Call a Private Sub from Another Module When a procedure requires a variable, subscribe to our VBA Insiders email series using the form below. A sub procedure is a section of code that carries an assignment but doesn't give back a result. In this part I will demonstrate how you can codify the analogous steps to incorporate stored procedures into your Visual Basic. Description. VBA, via the Visual Basic Editor (VBE), is flexible and allows you to determine how it responds to errors. A Public Sub in the objects, ThisWorkbook, ThisDocument, Sheet1, etc. Step #3: Select The Tab And Group Of Commands To Which You Want To Add The Macro. Use the stop time variables's Subtract method to subtract. NET you declare a procedure by using the Sub command, so where you see Sub below, please read as Procedure Declarations are where you state the name of your procedure/function and the code that you want to execute. VBA Events are procedures that run automatically when something happens. A function has a return type whereas a sub. The Initialize event code is added to the Excel VBA code module, with Sub and End Sub lines only. Notice that the code excludes a button named OKButton from the button group. A block of code that processes an input or handles a file is a good example of a function. This eliminates the need of writing same code over and over again. Hi, We have developed a Windows Application using vb. Sub show() UserForm1. In the Name box, type a name for your Web application, and then click OK. Most of the macros that we record or write in VBA are Sub procedures. Subscribe to this blog. PowerPoint Integration Through VBA; Ranges and Cells; SQL in Excel VBA - Best Practices; How to use ADODB. 'Procedure to multiply two numbers Sub sbMultiplyValues(ByVal intVal1 As Integer, ByVal intVal2 As Integer) MsgBox intVal1 * intVal2 End Sub How to call a function or a procedure? We can call a function from either a procedure or function or Worksheet. Types of procedure There are two types: Sub procedures and Function procedures. The examples here are straightforward illustrations of easy techniques to create charts, add and remove series, and move and resize charts using VBA. NET Project. Hello- Is it possible to use a variable to refer to a sub procedure? VBA only seems to recognize the literal name when compiling the code. NET Web Application under Templates. - An event procedure is a Sub procedure that is associated with a specific object and event. The difference between Sub procedures and Function procedures is that Function procedures return a value and Sub procedures do not. We’ll set up a text box on a form. The common dialog boxes control, which is a custom control, allows your project to use the dialog boxes that are provided as a part of the Windows environment. VBScript procedures. ByRef - ByVal. With VBA, you can do a lot of stuff with a workbook object - such as open a specific workbook, save and close workbooks, create new workbooks, change the workbook properties, etc. Instead, in your VBA editor right-click on the variable name (aArray) and select "Add watch". Copying Access database object from. Loading Unsubscribe from Nurture Tech? Cancel Unsubscribe. The manual says: "Like a Function procedure, a Sub procedure is a separate procedure that can take arguments, perform a series of statements, and change the value of its arguments. Therefore, if you wish to perform a task that returns a result (e. How to call Subroutine in VBA. Posted in VB. A combination of conditional statements and. These Variables will be file paths, which will be the result of the user selecting the folder locations as a result of the msofiledialoguepicker application. When you define a procedure, whether it's a Function or a Sub procedure, you need to decide whether the procedure arguments are passed. When setting up a Sub that accepts values, you place variable names between the round brackets: Sub SecondCode(BoldValue, NameValue, SizeValue). First, I would convert your macros to VBA code. A Sub procedure: is a series of statements, enclosed by the Sub and End Sub statements; can perform actions, but does not return a value; can take arguments that are passed to it by a calling procedure. Ie, if you want to calculate the volume of something, you might write the following function in a module:. Personally, I always use this format (with your sub name + additional comments for you where appropriate):. This helps me to identify easily what exactly is my object without the need to go and see the code or properties. We can now add code inside the procedure that will run when the user takes an action. The main distinction between the two is that a sub procedure completes a task, or sequence of tasks; a function procedure completes tasks but further, on completion, returns a value. There are. In Visual Basic, you can display a pop-up menu by calling the form's PopupMenu method, typically from within the MouseDown event procedure of the object: Private Sub List1_MouseDown(Button As Integer, Shift As Integer, _ X As Single, Y As Single) If Button And vbRightButton Then ' User right-clicked the list box. VLookup(E_name, Sheet1. This procedure is kicked off by the UserForm's Initialize event. In subsequent topics, I clear up confusion about these concepts. ' The Execute statement here creates a ' procedure that, when invoked, prints X. Sub procedures are generally used to accept input from the user and do required action and then print the results. Developers from all over the world come together to share knowledge, source code, and tutorials for free to help their fellow programmers - Professional Developers, Hobbyists and Students alike. Net using C# and VB. One of the subs called ends with a msgbox with vbOKCancel as its buttons. I probably havnt gotten deep into VB to fully understand how it all fits in together later on. In the VBE Editor set a reference to "Microsoft Visual Basic For Applications Extensibility 5. Run method The Application. By default, arguments are of the ByRef type, which means that if a variable is submitted as an argument, its reference will be transmitted. So let's get it right this time. You can put all the arguments on one line. Here's a list of the ways to execute a Sub procedure:. You need to supply the arguments to it, when it called. The main difference between a VBA Function procedure and a Sub procedure is that a Function procedure returns a result, whereas a Sub procedure does not. From Wikibooks, open books for an open world Use Exit Function or Exit Sub to terminate a procedure in the middle,. This video shows the difference between a function and a sub procedure in Visual Basic. You can execute a VBA Sub in many ways - that's one reason you can do so many useful things with Sub procedures. Sub procedure can be defined using Sub and End Sub keywords. Excel VBA Alarm Clock. Does your Recordset return -1 for its RecordCount property? If yes, this article will be able to help you and explain the cause and fixes. Also an event in the form is Private so it can only be called from within the form class. To call a Sub procedure from another procedure, type the name of the procedure and include values for any required arguments. When you're using Excel's Visual Basic Editor, a procedure is the block of statements that is enclosed by a particular declaration statement and End declaration. SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Net Tutorial. Visual Basic. Here's an example where I'm passing a text string, "Hello from Visual Basic", to the DisplayMessage Sub procedure, which displays that message in a console application:. The ByRef and ByVal modifiers are part of a procedure's signature and indicate how an argument is passed to a procedure. Object, _ ByVal e As System. However, you might have trouble moving information from the VBA procedure to the form, or retrieving information when the user has finished with the form. Find greatest and smallest number between three numbers in visual basic. Joel - you solution worked, but gets stuck going back up the tree if there is a sub assembly that is not used in a final assembly. Executing Sub procedure. The first sub Generates a shortcut to the procedure “TestMe” with Ctrl+C. Step #2: Choose To Work With Macros. You can put all the arguments on one line. Unlike a sub procedure, because a function returns a value, you must specify the type of value the function will produce. Each time the procedure is called, the statements between Sub and End Sub are executed. Public Class Book Public Title As String End Class Public Class BookUser Public Sub SomeMethod() Dim x as new Book() x. Sub Main is a special procedure that may be used by Visual Basic to launch an application. Example: I have frm1 with on Button: btn1 this btn1 has one event OnClick the code is Private Sub btn1_Click() msgbox( Clicked ) End Sub Now I have Howto Call [Event Procedure] from vba code in msaccess. Dim x As Example = New Example() ' The class inherits from Object, so we can cast it to an Object. In standard modules you will use Sub and Function procedures. All we need to do is add a Close() call to this procedure to exit the application: Private Sub ExitToolStripMenuItem_Click(ByVal sender As System. 00 Total Pay: $800. This form of the For loop in VBA is typically used when a particular action is to be performed on each of the constituent elements of the array. Even when you record a macro, Macro Recorder creates a SUB procedure. If you are creating a sub procedure, click the Sub radio button. As a result, you can only use this variable in sub1. The ByRef and ByVal modifiers are part of a procedure's signature and indicate how an argument is passed to a procedure. Click 'Validate Department If cmbDepartment. Defining a Function. This is known as a procedure call. in the procedure that is making the call put the following code Call Sheets(1). Sub procedures CAN be called without a call keyword. The purpose of VBA Class Modules is to allow us to custom build our own objects. Don't forget to close the loop. Posted in VB. NET tutorial-Learn VB. In the same way, for the rest of our lessons, the word procedure will be used to represent both types. Welcome back to our exploration of the wonderful world that's called Visual Basic. The syntax for a sub procedure is as follows: [Private | Public] [Static] Sub Procedurename [( arglist)] [ statements. Also Remember a function always has a return value and a sub procedure does not. If defined within a procedure, the variable is local to that procedure. If a sub procedure doesn't receive any arguments, its Sub statement must include an empty parenthesis(). In standard modules you will use Sub and Function procedures. The first step in a VB. HarleyQuinn-----The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. As an application developer, most of the time you'll be executing stored procedure programmatically. Where ‘-1’ is the index number. A function is similar to a sub procedure, however, there is one major difference. NET you declare a procedure by using the Sub command, so where you see Sub below, please read as Procedure Declarations are where you state the name of your procedure/function and the code that you want to execute. When a variable is passed to a sub or function, it is called an argument. Application") ' Open MyDatabaseName. Test Worksheet. A sub procedure is a series of VBScript statements, enclosed by Sub and End Sub statements which perform actions but do not return a value. Second, they. They are executed when they are called. Sub procedures are always enclosed within Sub and End Sub statements. You've already been exposed to the event procedures that VB creates when you want to execute code in response to a user action (such as the Click event of a command button). Property Procedures - Passing Information to and from Forms A userform is a convenient, professional-looking interface between a VBA procedure and the user. We are disclosing this in accordance with the Federal Trade Commission's 16 CFR, Part 255: "Guides Concerning the Use of Endorsements and Testimonials in Advertising" and also in accordance to amazon associates programme operating agreement. They cannot be used by other sub procedures or modules. How to Add Two Numbers in Visual Basic. Names(namedRange). A procedure is a series of VBA statements that resides in a VBA module, which you access in the Visual Basic Editor (VBE). To subclass a form you must replace the standard window procedure with your own custom procedure. Net using C# and VB. We have two kinds of procedures: The Sub procedure and the Function procedure. There is no need for the "outer" Sub OverallProcess (and in fact, in VBA, we cannot nest the Subs). A sub procedure can be placed in standard, class and form modules. show 'xTotal is the name of the label control and B4 is the column with a list of numbers: UserForm1. Between the start and the end of the procedure after the Sub keyword, as shown below. Press F8 to end our debugging session. It is commonly used piece of code which you will want to execute in various places in your program. We are using Module1, which contains SampleProcedure as the sample macro, which we want to delete. Sub Master() SalesData = GetInput("Enter Sales Data") If SalesData = False Then Exit Sub PostInput SalesData, "B3" End Sub Function GetInput(Message) Data = InputBox(Message) If Data = "" Then GetInput = False Else GetInput = Data End Function Sub PostInput(InputData, Target) Range(Target). A stored procedure is a procedure and a subfunction that is designed to perform a specific function. NET: Demo on FreeVBCode. This helps me to identify easily what exactly is my object without the need to go and see the code or properties. Mathias Brandewinder of Clear Lines Blog tweeted up Displaying a List of All VBA Procedures in an Excel 2007 Workbook from the Ribbon, an article by Microsoft’s Frank Rice on the MSDN web site, which showed a VBA procedure for listing all of the VBA procedures in a VB project. Finally, it opens every file, enters the VBA password, creates a list with all the VBA procedures and closes the file. ' RaiseEvent MyEvent End Sub End Class Public Class Test Sub TestEvent() ' ' Create the object that raises the event you want to handle. Call a Sub procedure by using the procedure name followed by the argument list. Sub procedures help to make programs smaller and seamless to manage. A Sub procedure returns no value. Overloading a procedure means you can give the same name to many procedures, but different in their arguments. , it will wait until the external process is closed before further execution in the calling app occurs. A combination of conditional statements and. Passing a Variable Number of Arguments Here's another valuable technique: You can create procedures that can accept a varying number of arguments. Writing Your Own SubProcedures and Functions in Visual Basic 6 Here's an example of some code that we can place in the click event procedure a command button which adds two numbers, and displays the result in a message box. A block of code that performs a calculation. Set appAccess = CreateObject("Access. Private Sub here means that the parameters , values and formulas that are used here belong only to the OK subprocedure(an object by itself). To call a Sub procedure from another procedure, type the name of the procedure and include values for any required arguments. but between is an exclusive operation. A sub procedure is a section of code that carries an assignment but doesn't give back a result. You can execute Function procedures and call the function in Excel 2016. The event is recognized by the control but it can not perform any action unless you define some code in that event. Both Visual Basic 6 and Visual Basic. Clear End Sub Related: How do I do to count rows in a sheets with filters? With a suppress lines excel,vba,filter I have a sheet with lots of columns, but when I filter and use count = Application. Random Public Class Form1 Private Sub Form1_Load(sender As Object, e As. In standard modules you will use Sub and Function procedures. Sub Procedure to Include VBscript code from another file. A sub procedure can be placed in standard, class and form modules. I want to say thanks for the replies. The event is recognized by the control but it can not perform any action unless you define some code in that event. To do this, you need to open your Access database. A sub procedure is usually used to accept input from the user, display information, print information, manipulate properties or perform some other tasks. Names(namedRange). Sub procedure can perform actions but doesn't return a value (but, you can use an object to get that value). Navigate to the sub procedure that you want to work with in the Visual Basic Editor. When programming VBA you write sequences of VBA statements in procedures in modules. Sub Procedures Whenever you record a macro in Excel the procedure the recording creates is a sub procedure. This is a (small) benefit because it hides the TextBox’s name (which might be changed). I have been trying to modify you code into a sub routine that I can control and modify, so that the output can be re-directed in exactly the way I need it. the Visual Basic statement used to invoke (call) an independent Sub procedure Cancel property a property of the e parameter in the form's FormClosing event procedure; when set to True, it prevents the form from closing. In fact, there's quite a lot of different ways you can run your Subs. How do I construct an SQL statement in VBA? Constructing an SQL statement in VBA can be tricky, because there are often several areas of Access needed to construct the string. CountA(Range("A:A")) It returns all the rows non Empty. A named argument consists of the name of the argument followed by a colon and an equal sign (:=), and the value assigned to the argument. net , datagridview in vb. Import data from a text file (ADO) using VBA in Microsoft Excel. Finally, End Sub ends the procedure definition. The VBA Sub is an essential component of the VBA language. To call an event procedure, you should call a public procedure within the form, and call the event procedure within this public procedure. All that remains is to call the stored procedure from Excel, providing the PayrollDate parameter of "2017/05/25". After this we have simply supplied the. The Call statement is not necessary to call a Sub, but if you want to use Call statement (Recommended), you must enclose arguments (if any) in parentheses. Welcome back to our exploration of the wonderful world that's called Visual Basic. I also have the same Dropbox cloud folder installed on my laptop. Sub procedures is a method that do not return a value, only perform the functions that you have written. The manual says: "Like a Function procedure, a Sub procedure is a separate procedure that can take arguments, perform a series of statements, and change the value of its arguments. Then it creates a list with all the Excel files that may contain VBA code (i. When calling a VBScript or a JavaScript procedure from an ASP file written in VBScript, you can use the "call" keyword followed by the procedure name. How to pass ByVal or ByRef parameters to sub-procedure and function. Like a Function procedure, a Sub procedure is a separate procedure that can take arguments, perform a series of statements, and change the value of its arguments. WorksheetFunction. How to Call a Function in VB. Building and running a Sub procedure. Review each of the terms and definitions in the VBA dictionary below to learn the fundamentals before taking CFI’s VBA Financial Modeling Course. NET; Oracle Stored Procedure from ASP. WriteLine(k+l) End Sub We define a procedure signature. The Sub procedure performs a task and then returns control to the calling code, but it does not return a value to the calling code. Hello- Is it possible to use a variable to refer to a sub procedure? VBA only seems to recognize the literal name when compiling the code. Sub procedures can be placed either in standard modules, class modules, or form modules. Hi and a warm welcome to my Excel blog if this is your first time visiting. 4 Modular Design. From Wikibooks, open books for an open world Use Exit Function or Exit Sub to terminate a procedure in the middle,. Fruit instead of frm. One of the subs called ends with a msgbox with vbOKCancel as its buttons. Difference between Dim and Set. Visual Basic for Applications VBA basics. A Sub procedure is a series of Visual Basic statements enclosed by the Sub and End Sub statements that performs actions but doesn't return a value. Step 4: We need to insert the value "Excel VBA", so select VALUE property by putting a dot after. In javascript it looks like this: var someValue = getThatValue() It's both calling and setting the value from the getThatValue() sub. G: Dim strSubName a. Navigate to the sub procedure that you want to work with in the Visual Basic Editor. In the same way, for the rest of our lessons, the word procedure will be used to represent both types. A very useful way of executing a macro is by telling Excel that a Sub procedure should be executed when a particular event occurs. When you write a VBA macro, the code is in a Sub procedure. To create a sub procedure, start the section of code with the Sub keyword followed by a name for the sub procedure. Most of the macros that we record or write in VBA are Sub procedures. Sub procedure can perform actions but doesn't return a value (but, you can use an object to get that value). This variable is unknown by any other macros. However, when arguments are passed to a procedure from other procedures, then these are listed or declared between the parentheses. In the Visual Basic Editor, click Insert, Module. The scope determines which modules and procedures can use a given variable. To make the procedure available to an entire application, select Public as the scope; to make the procedure private to this module, select Private. NET Programming" End Sub End Class Restricting access to classes and class members is not only a good programming practice but is also necessary to avoid any accidental misuse of your classes. If calling a sub procedure, after the name of the procedure, put an empty space, followed by the name of the argument assigned the desired value. Text) > 0) Then 'Enabling the Add button 'if atleast one character 'is entered cmdAdd. Each procedure performs a set of specific tasks and is relatively independent of the remaining code. The ByRef and ByVal modifiers are part of a procedure's signature and indicate how an argument is passed to a procedure. A VBA procedure is defined by a beginning declaration statement (Sub or Function) and an ending statement with statements in between. To see how this works, type the following into your code module: Private Sub Form1_Load(ByVal sender As System. NET An event is an action that is performed when user interact with particular control. A procedure holds a group of VBA statements that accomplishes a desired task. Then it creates a list with all the Excel files that may contain VBA code (i. Instead of using the End statement we need to use the VBA Exit statement. You can also create functions in Visual Basic. The above technique we have just seen for using the parentheses is valid for sub procedures and functions. 2 Built-In Functions Visual Basic. Private Sub cmdAdd_Click() lstName. Each time the procedure is called, its statements are executed, starting with the first executable statement after the Sub statement and ending with the first End Sub, Exit Sub, or Return statement encountered. Sub procedure: The sub-procedure does not return a value. Private Sub Workbook_AfterSave(ByVal Success As Boolean) End Sub Workbook_SheetActivate. Depending on an author, in the Visual Basic language, the word "procedure" means either a sub-procedure created with the Sub keyword, or a function created with the Function keyword. Sub Addition(ByVal k As Integer, ByVal l As Integer) Console. The examples here are straightforward illustrations of easy techniques to create charts, add and remove series, and move and resize charts using VBA. Code 1: The below code is useful to select blank option in Combo Box. Value End Sub VBA ComboBox Default Values in Excel. When you're using Excel's Visual Basic Editor, a procedure is the block of statements that is enclosed by a particular declaration statement and End declaration. Excel Visual Basic (VBA) for Beginners - Part 1 of 4: Buttons and Macros - Duration: 6:49. Executing Sub procedure. In the same way, for the rest of our lessons, the word procedure will be used to represent both types. The event is recognized by the control but it can not perform any action unless you define some code in that event. Unlike a sub procedure, because a function returns a value, you must specify the type of value the function will produce. NET: Imports System. In Visual Basic we create constructors by adding a Sub procedure named New to a class. This macro also displays the name of each worksheet. A huge welcome back if you are a regular. VBScript is one of the languages that can be accessed by the 4Dos, 4NT, and Take Command enhanced shells. You can omit the parentheses only if you don't supply any arguments. You can use a UDF in the Sub procedure. DoEvents ( ). I was able to format and get the results. NET tutorial-Learn VB.