Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub Muotoile()
- Dim Vika As Integer
- Vika = Range("A65536").End(xlUp).Row
- Columns("A:A").Insert Shift:=xlToRight
- Range("A1").FormulaR1C1 = "1"
- Range("A2").FormulaR1C1 = "2"
- Range("A1:A2").AutoFill Destination:=Range("A1:A" & Vika)
- Range("A1:A" & Vika).Copy Range("A" & Vika + 1)
- Columns("A:C").Select
- ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Clear
- ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=Range("A1:A20") _
- , SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
- With ActiveWorkbook.Worksheets("Sheet1").Sort
- .SetRange Range("A1:C" & 2 * Vika)
- .Header = xlGuess
- .MatchCase = False
- .Orientation = xlTopToBottom
- .SortMethod = xlPinYin
- .Apply
- End With
- Columns("A:A").Delete
- Range("B1:B" & 2 * Vika).Cut Range("B2")
- Range("A1").Select
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement