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





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






VBA StatementO que fazem
AppActivateAtiva uma janela de applicação
BeepEnvia um beep pelo alto falante do PC
CallTransfere o controle para outra Procedure
ChDirMuda o diretório corrente
ChDriveMuda o Drive corrente
CloseFecha um arquivo texto
ConstDeclara um valor Constante
DateSets the current system date
DeclareDeclara uma referência a um procedure externa numa DLL (Dynamic Link Library)
DeleteSettingDeletes a section or key setting from an application's entry in the Windows Registry
DimDeclares variables and (optionally) their data types
Do-LoopLoops through a set of instructions
EndUsed by itself, exits the program; also used to end a block of statements that begin with If, With, Sub, Function, Property, Type, or Select
EraseRe-initializes an array
ErrorSimulates a specific error condition
Exit DoExits a block of Do-Loop code
Exit ForExits a block of For-Next code
Exit FunctionExits a Function procedure
Exit PropertyExits a property procedure
Exit SubExits a subroutine procedure
FileCopyCopies a file
For Each-NextLoops through a set of instructions for each member of a series
For-NextLoops through a set of instructions a specific number of times
FunctionDeclares the name and arguments for a Function procedure
GetReads data from a text file
GoSub...ReturnBranches to and returns from a procedure
GoToBranches to a specified statement within a procedure
If-Then-ElseProcesses statements conditionally
Input #Reads data from a sequential text file
KillDeletes a file from a disk
LetAssigns the value of an expression to a variable or property
Line Input #Reads a line of data from a sequential text file
LoadLoads an object but doesn't show it
Lock...UnlockControls access to a text file
MidReplaces characters in a string with other characters
MkDirCreates a new directory
NameRenames a file or directory
On ErrorGives specific instructions for what to do in the case of an error
On...GoSubBranches, based on a condition
On...GoToBranches, based on a condition
OpenOpens a text file
Option BaseChanges the default lower limit for arrays
Option CompareDeclares the default comparison mode when comparing strings
Option ExplicitForces declaration of all variables in a module
Option PrivateIndicates that an entire module is Private
Print #Writes data to a sequential file
PrivateDeclares a local array or variable
Property GetDeclares the name and arguments of a Property Get procedure
Property LetDeclares the name and arguments of a Property Let procedure
Property SetDeclares the name and arguments of a Property Set procedure
PublicDeclares a public array or variable
PutWrites a variable to a text file
RaiseEventFires a user-defined event
RandomizeInitializes the random number generator
ReDimChanges the dimensions of an array
RemSpecifies a line of comments (same as an apostrophe ['])
ResetCloses all open text files
ResumeResumes execution when an error-handling routine finishes
RmDirRemoves an empty directory
SaveSettingSaves or creates an application entry in the Windows Registry
SeekSets the position for the next access in a text file
Select CaseProcesses statements conditionally
SendKeysSends keystrokes to the active window
SetAssigns an object reference to a variable or property
SetAttrMuda o attributo de um arquivo
StaticDeclares variables at the procedure level so that the variables retain their values as long as the code is running
StopPausa o programa
SubDeclara o nome e o argumento de uma Sub Procedure
TimeSets the system time
TypeDefines a custom data type
UnloadRemove um objeto da memória
While...WendEfetua 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
WithSets a series of properties for an object
Write #Grava os dados num arquivo texto sequencial




Reference:: John Walkenbach




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



Um comentário:

diHITT - Notícias