Jun 11, 2014 · Example 1: Displaying a variable in a message box Sub variables() Dim new_variable As Integer new_variable = 10 MsgBox new_variable End Sub. In this VBA program, first new_variable is declared to be a variable of data type integer. In other it can store integer values. In the next statement the variable is assigned value 10. Finally, the ... In earlier post we have talked about MsgBox which is exactly opposite to VBA InputBox. The job of InputBox function in VBA is to get some input from the user. It displays a dialog to the user that gives him a cue of which value should be entered, then it returns this value to the program. Advanced Access Export Function To Excel Spreadsheet Using VBA Multiple Access Functions Export Data To An Excel Spreadsheet. This example utilizes several advanced VBA functions to export an Access table to Excel. The user enters a file path for output, then clicks on the command button to start the Access VBA export function. How To Name VBA Variables. Visual Basic for Applications provides a lot of flexibility in connection with how you can name variables. As a general matter, the rules that apply to variable naming are substantially the same rules that apply to most other elements within Visual Basic for Applications. Excel Macro - VBA - Message box. ... 3. & should be used to get the value of the variable. Posted 3rd September 2016 by Anonymous. 0 Add a comment Excel Macro VBA.