Sub copiar_Valores()Sheets("Planilha1").Range("A1").CopySheets("Planilha2").Range("A1").PasteSpecial Paste:=xlPasteValues End Sub
Sub preencher_Aleatorio()For i = 1 To 10 Cells(i, 1).Value = Int((100 * Rnd) + 1)Next i End Sub
Sub filtrar_Dados()Sheets("Planilha1").Range("A1:D10").AutoFilter Field:=1, Criteria1:="nome" End Sub
Sub enviar_Emails()Dim email As String, assunto As String, corpo As Stringemail = "destinatario@dominio.com"assunto = "Assunto do email"corpo = "Corpo do email"With CreateObject("Outlook.Application").CreateItem(0) .To = email .Subject = assunto .Body = corpo .sendEnd With End Sub
Sub criar_Grafico()Sheets("Planilha1").SelectRange("A1:D10").SelectActiveSheet.Shapes.AddChart2(251, xlLine).SelectActiveChart.SetSourceData Source:=Range("Planilha1!$A$1:$D$10") End Sub