Sub FormatarCélulas() Range("B2:G10").Select With Selection.HorizontalAlignment = xlCenter.VerticalAlignment = xlCenter.Font.Bold = True.Borders(xlDiagonalDown).LineStyle = xlNone.Borders(xlDiagonalUp).LineStyle = xlNone.Borders(xlEdgeLeft).LineStyle = xlContinuous.Borders(xlEdgeTop).LineStyle = xlContinuous.Borders(xlEdgeBottom).LineStyle = xlContinuous.Borders(xlEdgeRight).LineStyle = xlContinuous.Borders(xlInsideVertical).LineStyle = xlContinuous.Borders(xlInsideHorizontal).LineStyle = xlContinuous End With End Sub
Sub AdicionarRegistro() Dim lngUltimaLinha As Long lngUltimaLinha = Range("A" & Rows.Count).End(xlUp).Row Range("A" & lngUltimaLinha + 1).Select ActiveCell.FormulaR1C1 = "=MAX(R[-1]C:R[" & lngUltimaLinha - 1 & "]C)+1" ActiveCell.Offset(0, 1).Select End Sub
Sub FiltrarTabela() ActiveSheet.ListObjects("Tabela1").Range.AutoFilter Field:=1, Criteria1:=">100" End Sub
Sub NovaPlanilha() Dim wb As Workbook Set wb = Workbooks.Add End Sub
Sub InserirGrafico() Dim cht As Chart Set cht = ActiveSheet.Shapes.AddChart2(332, xlColumnClustered).Chart End Sub