VBA Excel - Comando comuns no MS Excel - Common VBA Statements for Excel VBA Programming

Inline image 1

Que tal uma lista de funções e instruções que podem ser utilizadas no VBA do Microsoft Office?

VBA Statement O que fazem
AppActivate Ativa uma janela de applicação
Beep Envia um beep pelo alto falante do PC
Call Transfere o controle para outra Procedure
ChDir Muda o diretório corrente
ChDrive Muda o Drive corrente
Close Fecha um arquivo texto
Const Declara um valor Constante
Date Sets the current system date
Declare Declara uma referência a um procedure externa numa DLL (Dynamic Link Library)
DeleteSetting Deletes a section or key setting from an application's entry in the Windows Registry
Dim Declares variables and (optionally) their data types
Do-Loop Loops through a set of instructions
End Used by itself, exits the program; also used to end a block of statements that begin with If, With, Sub, Function, Property, Type, or Select
Erase Re-initializes an array
Error Simulates a specific error condition
Exit Do Exits a block of Do-Loop code
Exit For Exits a block of For-Next code
Exit Function Exits a Function procedure
Exit Property Exits a property procedure
Exit Sub Exits a subroutine procedure
FileCopy Copies a file
For Each-Next Loops through a set of instructions for each member of a series
For-Next Loops through a set of instructions a specific number of times
Function Declares the name and arguments for a Function procedure
Get Reads data from a text file
GoSub...Return Branches to and returns from a procedure
GoTo Branches to a specified statement within a procedure
If-Then-Else Processes statements conditionally
Input # Reads data from a sequential text file
Kill Deletes a file from a disk
Let Assigns the value of an expression to a variable or property
Line Input # Reads a line of data from a sequential text file
Load Loads an object but doesn't show it
Lock...Unlock Controls access to a text file
Mid Replaces characters in a string with other characters
MkDir Creates a new directory
Name Renames a file or directory
On Error Gives specific instructions for what to do in the case of an error
On...GoSub Branches, based on a condition
On...GoTo Branches, based on a condition
Open Opens a text file
Option Base Changes the default lower limit for arrays
Option Compare Declares the default comparison mode when comparing strings
Option Explicit Forces declaration of all variables in a module
Option Private Indicates that an entire module is Private
Print # Writes data to a sequential file
Private Declares a local array or variable
Property Get Declares the name and arguments of a Property Get procedure
Property Let Declares the name and arguments of a Property Let procedure
Property Set Declares the name and arguments of a Property Set procedure
Public Declares a public array or variable
Put Writes a variable to a text file
RaiseEvent Fires a user-defined event
Randomize Initializes the random number generator
ReDim Changes the dimensions of an array
Rem Specifies a line of comments (same as an apostrophe ['])
Reset Closes all open text files
Resume Resumes execution when an error-handling routine finishes
RmDir Removes an empty directory
SaveSetting Saves or creates an application entry in the Windows Registry
Seek Sets the position for the next access in a text file
Select Case Processes statements conditionally
SendKeys Sends keystrokes to the active window
Set Assigns an object reference to a variable or property
SetAttr Muda o attributo de um arquivo
Static Declares variables at the procedure level so that the variables retain their values as long as the code is running
Stop Pausa o programa
Sub Declara o nome e o argumento de uma Sub Procedure
Time Sets the system time
Type Defines a custom data type
Unload Remove um objeto da memória
While...Wend Efetua um Loop através do conjunto de instruções, de acordo com certa condição verdadeira
Width # Sets the output line width of a text file
With Sets a series of properties for an object
Write # Grava os dados num arquivo texto sequencial

Reference:: John Walkenbach

Tags: VBA, Instrunctions, Office,  code, script, techniques

Inline image 1


Related Posts Plugin for WordPress, Blogger...