Descricao: |
Saberexcel - o site de quem precisa aprender sobre macros Microsoft Excel VBA
 Esse macro do Aplicativo Microsoft Excel VBA, insere bordas em determinada área da folha de planilha usando a instrução for next, observe que a largura entre linhas são alternadas pela altura diferente as cores da borda exterior de cor diferente. Então se voce precisa de algo parecido o macro poderá ajudá-lo. Fique com Deus, Expedito Marcondes. ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Sub sbx_insere_bordas_linhas_alternadas() For X = 0 To 5 Range("A4").Offset(X * 2, 0).EntireRow.Insert With Range("A4:G4").Offset(X * 2, 0) .RowHeight = 65 .HorizontalAlignment = xlCenter .VerticalAlignment = xlTop .WrapText = True .Font.Size = 10 .Font.Bold = False 'Desbloquear células para inserir texto mais tarde, após planilha estiver protegida. .Locked = False End With
' colocar bordas em determinada área With Range("A3").Offset(X * 2, 0).Resize(2, 7).Borders(xlLeft) .Weight = xlThick .ColorIndex = xlAutomatic End With
With Range("A3").Offset(X * 2, 0).Resize(2, 7).Borders(xlRight) .Weight = xlThick .ColorIndex = xlAutomatic End With
Range("A3").Offset(X * 2, 0).Resize(2, 7).BorderAround _ Weight:=xlThick, ColorIndex:=5 ' :=xlAutomatic Next End Sub ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Sub sbx_limpar_teste() With Cells .Clear .RowHeight = 15 End With End Sub ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 Aprenda tudo sobre planilhas do Aplicativo Microsoft Excel VBA(Visual Basic Application), sozinho, com baixo custo, praticando com os produtos didáticos Escola Saberexcel VBA Estudos® - Treinamentos com Macros, Fórmulas e Funções.

|