A-List-of-Excel-VBA-Commands
A-List-of-Excel-VBA-Commands
Workbooks Miscellaneous
Returns a collection of all the open Displays a message box with a message and
Workbooks() MsgBox
workbooks. optional buttons and icons.
Returns the active workbook, which is
ActiveWorkbook InputBox Displays an input box to get input from the user.
the currently displayed workbook.
Creates a reference to an external object or
Saves a workbook with a different file
SaveAs() CreateObject application, such as a Word document or an
name or format.
Outlook email message.
Open() Opens a workbook from a file path. Shell Runs an external program or command.
Saves changes to a workbook or a copy
Save of a workbook with a new name or Timer Returns the number of seconds since midnight.
location.
Returns the value of an environment variable,
Close Closes a workbook. Environ such as the user's username or the path to the
Windows directory.
Returns a reference to the workbook
ThisWorkbook that contains the VBA code that is ClearContents() Clears the contents of the selected range.
currently running.
A List of Most Commonly Used VBA Commands in Excel
Data Validation
ValidationType Sets or returns the type of data validation to apply to a range of cells.
InputTitle Sets or returns the title of the input message that appears when a user selects a cell with data validation.
InputMessage Sets or returns the text of the input message that appears when a user selects a cell with data validation.
Sets or returns the title of the error message that appears when a user enters invalid data in a cell with data
ErrorTitle
validation.
Sets or returns the text of the error message that appears when a user enters invalid data in a cell with data
ErrorMessage
validation.
ShowInput Determines whether to display the input message when a user selects a cell with data validation.
ShowError Determines whether to display the error message when a user enters invalid data in a cell with data validation.
InCellDropdown Determines whether to display a dropdown arrow in cells with data validation that allow a list.
Formula1 Sets or returns the first value or expression to use in a data validation rule.
Formula2 Sets or returns the second value or expression to use in a data validation rule, if applicable.
Excelgraduate
© 2023 excelgraduate.com | All rights reserved.