Saberexcel - o site das macros
 Esse macro do Aplicativo Microsoft Excel VBA(Visual Basic Application), insere um cabeçalho formatado linhas e colunascom altura e largura de linhas, em seguida insere anos nas colunas por meio de um arrays, formata a fonte (estilo e tamanho) na linha(2). Espero que o exemplo lhes sejam útil. Fiquem com Deus, Expedito Marcondes.
Sub Inserindo_cabecalho_ajustando_linhas_colunas() Set vPlan = Saber1
With vPlan.Range("B1:E1") .Value = Array(2010, 2011, 2012, 2013) .HorizontalAlignment = xlCenter '.Style = "Title" .ColumnWidth = 39 'largura das colunas .Offset(1, 0).RowHeight = 100 ''altura das linhas End With
With vPlan.Range("B2:E2") .Value = Array("Saberexcel", "Saberexcel", "Saberexcel", "Saberexcel") .Font.Name = "Old English Text MT" .Font.Size = 28 .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter End With
[A3].Select End Sub
Sub Limpar_para_teste() Set vPlan = Saber1 Cells.Clear
With vPlan.Range("B1:E3") .ColumnWidth = 8.57 .RowHeight = 15.75 End With
[A3].Select End Sub
 Aprenda tudo sobre planilhas do Aplicativo Microsoft Excel VBA(Visual Basic Application), sozinho, com baixo custo, praticando com os produtos didáticos Saberexcel
 |