Você está na página 1de 2

Curso VBA Excel

Sub nome_da_macro()

End

Dim x as Integer/Double/String/Date/Boolean
X=10
Msgbox(x)
Cells(1,1).Value=x
ActiveCell.Value=x

Dim Range1 as Range


Set Range1=Range(D10:G15)
Range1.Value=teste
Range1.Cells(3,2).Value=oi

Range(B5).Value=5
Range(A2,G8)=3 completa clulas com os valores
Range(A1:F8)=Ol completa tudo com Ol

Range1.Select
Selection.ClearContents (deleta tudo que est no range)
Selection.Font.Color = -

16776961

Selection.Interior.Color = 65535
Selection.Font.Bold = True

Dim Range2 as Range


Set Range2=Range(A1:C5)
Range2.Cells(1,1).Value = 299
Range2.Offset(5,0).Value=579 (desloca o range 5 clulas para baixo, 0
clulas para direita e escreve 579 em todo o intervalo) funciona como
procv

If CONDIO Then

Else

End If

For i=1 to 10

Next

Dim var, i as integer


Dim range1, cell as range
Set rangre1 = Range(G1:G10)
For each cell In range1
Cell.Value = 1
Next

Você também pode gostar