0% found this document useful (0 votes)
65 views4 pages

Comando Macro

The macro sorts and formats data on the "Abril '17 PREConc" worksheet. It sorts the data in columns H, I, Q, and R in ascending order. It then applies number formatting to columns H, I, and Q-R and adjusts column widths. Finally, it inserts rows, applies autofilter, and shows outline levels to structure the data.

Uploaded by

Angelito García
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views4 pages

Comando Macro

The macro sorts and formats data on the "Abril '17 PREConc" worksheet. It sorts the data in columns H, I, Q, and R in ascending order. It then applies number formatting to columns H, I, and Q-R and adjusts column widths. Finally, it inserts rows, applies autofilter, and shows outline levels to structure the data.

Uploaded by

Angelito García
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Sub Ordenar()

'

' Ordenar Macro

'

'

ActiveSheet.Previous.Select

ActiveSheet.Previous.Select

Range("B264").Select

Selection.End(xlUp).Select

Range("B4").Select

Range(Selection, Selection.End(xlToRight)).Select

Range(Selection, Selection.End(xlToRight)).Select

Range(Selection, Selection.End(xlToRight)).Select

Range(Selection, Selection.End(xlToRight)).Select

Range(Selection, Selection.End(xlDown)).Select

Selection.Copy

ActiveSheet.Next.Select

ActiveSheet.Next.Select

Range("B1").Select

ActiveSheet.Paste

ActiveSheet.Previous.Select

Range("A3").Select

Range(Selection, Selection.End(xlToRight)).Select

Range("A3:F3").Select

Range(Selection, Selection.End(xlDown)).Select

Application.CutCopyMode = False

Selection.Copy

ActiveSheet.Next.Select
Range("M1").Select

ActiveSheet.Paste

Columns("B:I").Select

Application.CutCopyMode = False

ActiveWorkbook.Worksheets("Abril '17 PREConc").Sort.SortFields.Clear

ActiveWorkbook.Worksheets("Abril '17 PREConc").Sort.SortFields.Add Key:= _

Columns("H:H"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _

xlSortNormal

With ActiveWorkbook.Worksheets("Abril '17 PREConc").Sort

.SetRange Columns("B:I")

.Header = xlGuess

.MatchCase = False

.Orientation = xlTopToBottom

.SortMethod = xlPinYin

.Apply

End With

ActiveWorkbook.Worksheets("Abril '17 PREConc").Sort.SortFields.Clear

ActiveWorkbook.Worksheets("Abril '17 PREConc").Sort.SortFields.Add Key:= _

Columns("I:I"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _

xlSortNormal

With ActiveWorkbook.Worksheets("Abril '17 PREConc").Sort

.SetRange Columns("B:I")

.Header = xlGuess

.MatchCase = False

.Orientation = xlTopToBottom

.SortMethod = xlPinYin

.Apply

End With

Columns("M:R").Select
ActiveWorkbook.Worksheets("Abril '17 PREConc").Sort.SortFields.Clear

ActiveWorkbook.Worksheets("Abril '17 PREConc").Sort.SortFields.Add Key:= _

Columns("R:R"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _

xlSortNormal

With ActiveWorkbook.Worksheets("Abril '17 PREConc").Sort

.SetRange Columns("M:R")

.Header = xlGuess

.MatchCase = False

.Orientation = xlTopToBottom

.SortMethod = xlPinYin

.Apply

End With

ActiveWorkbook.Worksheets("Abril '17 PREConc").Sort.SortFields.Clear

ActiveWorkbook.Worksheets("Abril '17 PREConc").Sort.SortFields.Add Key:= _

Columns("Q:Q"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _

xlSortNormal

With ActiveWorkbook.Worksheets("Abril '17 PREConc").Sort

.SetRange Columns("M:R")

.Header = xlGuess

.MatchCase = False

.Orientation = xlTopToBottom

.SortMethod = xlPinYin

.Apply

End With

Range("H:I,Q:R").Select

Range("Q1").Activate

Selection.NumberFormat = "#,##0.00_ ;[Red]-#,##0.00 "

Cells.Select

Cells.EntireColumn.AutoFit
Rows("1:1").Select

Selection.Insert Shift:=xlDown

Range("A2").Select

ActiveCell.FormulaR1C1 = "1"

Range("A3").Select

ActiveCell.FormulaR1C1 = "2"

Range("A4").Select

ActiveCell.FormulaR1C1 = "3"

Range("A2:A4").Select

Selection.AutoFill Destination:=Range("A2:A270")

Range("A2:A270").Select

ActiveWindow.SmallScroll Down:=-42

Range("A1:R1").Select

Selection.AutoFilter

Range("J:J,L:L").Select

Range("L1").Activate

Selection.ColumnWidth = 4.14

Range("D7").Select

ActiveSheet.Outline.ShowLevels RowLevels:=0, ColumnLevels:=1

ActiveSheet.Outline.ShowLevels RowLevels:=0, ColumnLevels:=2

Range("C:C,D:D").Select

Range("D1").Activate

Selection.ColumnWidth = 22.57

Range("H3").Select

End Sub

You might also like