Results 1 to 9 of 9

Correcting Macro Run-Time error '9' - Subscript out of range

Threaded View

  1. #1
    Registered User
    Join Date
    08-19-2016
    Location
    Michigan, United States
    MS-Off Ver
    2016 and 365
    Posts
    7

    Correcting Macro Run-Time error '9' - Subscript out of range

    So, I am an average to above average Excel user but am trying to dabble into Macros to make my life easier. I'm trying to create this macro to take a report I pull in from SAP and format it to the way the Senior Management Team wants it in. I keep getting the "Run-time error '9': Subscript out of range" error. I have no clue how to debug this or even how to re-record the macro so that it will be successful. If I can get this macro to work it will save me SOOO much time. I appreciate any help or assistance this group can provide. Thank you in advance for your time.



    Cells.Select
        Cells.EntireColumn.AutoFit
        Rows("1:6").Select
        Selection.Delete Shift:=xlUp
        Columns("A:A").Select
        Selection.Delete Shift:=xlToLeft
        Rows("2:2").Select
        Selection.Delete Shift:=xlUp
        Cells.Select
        Cells.EntireColumn.AutoFit
        ActiveWorkbook.Worksheets("Report Cleanup").Sort.SortFields.Clear
        ActiveWorkbook.Worksheets("Report Cleanup").Sort.SortFields.Add Key:=Range( _
            "A2:A84"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
            xlSortNormal
        With ActiveWorkbook.Worksheets("Report Cleanup").Sort
            .SetRange Range("A1:BB84")
            .Header = xlYes
            .MatchCase = False
            .Orientation = xlTopToBottom
            .SortMethod = xlPinYin
            .Apply
        End With
    Last edited by Cdub529; 08-19-2016 at 04:10 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Headache with formula
    By crazytimechris in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-07-2015, 10:25 AM
  2. Massive =IF headache
    By paradox34690 in forum Excel General
    Replies: 7
    Last Post: 03-22-2012, 09:08 PM
  3. Formula headache!
    By JoeyG in forum Excel General
    Replies: 0
    Last Post: 04-03-2007, 04:18 PM
  4. what a headache please help
    By Crasher in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-28-2006, 07:02 PM
  5. That wonderful day of 2/29 gives me a headache...
    By Tibbets in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-06-2006, 02:15 PM
  6. Multiple Userform Macro Headache
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-28-2006, 11:05 AM
  7. headache! :) unique_id's
    By cjjoo in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-20-2005, 10:24 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1