Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 06-01-2012, 11:30 AM
gbaker gbaker is offline runtime error 1004 Windows 7 32bit runtime error 1004 Office 2010 32bit
Competent Performer
runtime error 1004
 
Join Date: May 2012
Posts: 111
gbaker is on a distinguished road
Default Runtime error '2147417848(800101108)

I got rid of the merged cells and noticed that the freeze pane was also interferring with the sort. I am still getting another error called:
Runtime error '2147417848(800101108)

Debug line is .Apply (text is highlighted in red below in the code.

Code:
Sub SortDaysProvider()
    Dim DayRange As Long
    Dim TopRow As Long
    Dim sRange As Range
    Dim fRange As Range
 
    Application.ScreenUpdating = False
 
    For DayRange = 1 To 365
        TopRow = (DayRange * 17) + 9
 
        With ActiveWorkbook.Worksheets("Input Calendar (2012)")
 
            Set sRange = .Range("E" & TopRow & ":" & "BN" & TopRow + 14)
            Set fRange = .Range("E" & TopRow & ":" & "E" & TopRow + 14)
 
            With .Sort
                .SortFields.Add _
                     Key:=fRange, _
                     SortOn:=xlSortOnValues, _
                     Order:=xlAscending, _
                     DataOption:=xlSortNormal
                 .SetRange sRange
                 .Header = xlGuess
                 .MatchCase = False
                 .Orientation = xlTopToBottom
                 .SortMethod = xlPinYin
                 .Apply
                 .SortFields.Clear
            End With
        End With
    Next DayRange
 
    Application.ScreenUpdating = True
End Sub
Thanks in advance for all your help with this!!!
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
runtime error 1004 Open Word w Excel & fill Word textboxes w info from Excel fields runtime error 4248 Joe Patrick Word VBA 2 01-30-2012 07:23 AM
runtime error 1004 Runtime Error 4120 in Word 2007 macro Frankwlc Word 5 11-28-2011 01:54 AM
runtime error 1004 Runtime error 91 waldux Word VBA 1 03-04-2011 11:25 PM
Runtime error 5487 - Word cannot complete the save to to file permission error franferns Word 0 11-25-2009 05:35 AM
Installing Access Runtime ziggy0508 Office 1 09-29-2005 04:21 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:09 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft