Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub Macro6()
- '
- ' Ordenar universo de OT's e formatar a tabela de saĆda
- '
- ' Atalho por teclado: Ctrl+w
- '
- Dim tamanho As Variant
- Dim tamanhot As Variant
- tamanho = Range("A65536").End(xlUp).Row
- Worksheets("Folha1").Range(Cells(16, 1), Cells(tamanho, 5)).Sort Key1:=Worksheets("Folha1").Columns("E"), Order1:=xlAscending
- If tamanho < 51 Then
- Range("C51").Select
- ActiveCell.FormulaR1C1 = "O XXXXXXX"
- Range("C52").Select
- ActiveCell.FormulaR1C1 = "_______________"
- Range("C53").Select
- ActiveCell.FormulaR1C1 = "__________"
- Range("C51:c53").Select
- With Selection
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlBottom
- .WrapText = False
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
- Else
- tamanho = Range("D65536").End(xlUp).Row
- tamanho = tamanho + 4
- Range(Cells(tamanho, 3), Cells(tamanho, 3)).Select
- ActiveCell.FormulaR1C1 = "O XXXXXXX"
- tamanho = tamanho + 1
- Range(Cells(tamanho, 3), Cells(tamanho, 3)).Select
- 'Range("C52").Select
- ActiveCell.FormulaR1C1 = "_______________"
- tamanho = tamanho + 1
- 'Range("C53").Select
- Range(Cells(tamanho, 3), Cells(tamanho, 3)).Select
- ActiveCell.FormulaR1C1 = "__________"
- tamanhot = tamanho
- tamanho = tamanho - 2
- Range(Cells(tamanho, 3), Cells(tamanhot, 3)).Select
- 'Range("C51:c53").Select
- With Selection
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlBottom
- .WrapText = False
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
- End If
- Range("A1").Activate
- End Sub
- 'https://lh4.googleusercontent.com/-OGNs1yEAeYw/TmecKZgX9qI/AAAAAAAAA8E/US5nw3XNIN8/s1068/prioridades_3.jpg
- 'https://lh3.googleusercontent.com/-WVZpoB-RBBw/TmecNcA62UI/AAAAAAAAA8M/RQu5XOgt1Ug/s1072/prioridades_4.jpg
Advertisement
Add Comment
Please, Sign In to add comment