View Single Post
 
Old 07-13-2012, 10:01 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try:
Code:
Sub SortDaysProvider2()
Application.ScreenUpdating = False
With ActiveWorkbook.Worksheets("DATABNY").Sort
  For DayRange = 1 To 365
    TopRow = (DayRange * 16) + 14
    sRange = "B" & TopRow & ":" & "O" & TopRow + 15
    fRange = "B" & TopRow & ":" & "B" & TopRow + 15
    .SortFields.Clear '****************************
    .SortFields.Add Key:=Range(fRange), SortOn:=xlSortOnValues, _
        Order:=xlAscending, DataOption:=xlSortNormal
    .SetRange Range(sRange)
    .Header = xlGuess
    .MatchCase = False
    .Orientation = xlTopToBottom
    .SortMethod = xlPinYin
    .Apply
  Next DayRange
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote