+ Reply to Thread
Results 1 to 3 of 3

Error running macro

  1. #1
    Pat
    Guest

    Error running macro

    The following macro I run from a custom button on a custom toolbar:

    Sub SortRef()

    Range("G6:T1000").Select
    Selection.Sort Key1:=Range("G6"), Order1:=xlAscending, Header:=xlGuess,
    _
    OrderCustom:=2, MatchCase:=False, Orientation:=xlTopToBottom
    Range("H6:H1000").Select
    Selection.Font.ColorIndex = 10
    Range("I6:I3000").Select
    Selection.Font.ColorIndex = 41
    Range("J6:J3000").Select
    Selection.Font.ColorIndex = 13
    Range("L6:L3000").Select
    Selection.Font.ColorIndex = 3
    Range("G4").Select

    End Sub

    When it's run the following message appears:

    'Object library invalid or contains references to object definitions that
    could not found'

    Anyone know how to fix this?

    Thank you
    Pat



  2. #2
    Don Guillett
    Guest

    Re: Error running macro

    First, let's get rid of the selections. Now, could it be that you are
    running on a sheet that does not have these ranges?

    Sub SortRef()
    Range("G6:T1000").Sort Key1:=Range("G6"), Order1:=xlAscending,
    Header:=xlGuess, _
    OrderCustom:=2, MatchCase:=False, Orientation:=xlTopToBottom
    Range("H6:H1000").Font.ColorIndex = 10
    Range("I6:I3000").Font.ColorIndex = 41
    Range("J6:J3000").Font.ColorIndex = 13
    Range("L6:L3000").Font.ColorIndex = 3
    End Sub

    --
    Don Guillett
    SalesAid Software
    [email protected]
    "Pat" <[email protected]> wrote in message
    news:[email protected]...
    > The following macro I run from a custom button on a custom toolbar:
    >
    > Sub SortRef()
    >
    > Range("G6:T1000").Select
    > Selection.Sort Key1:=Range("G6"), Order1:=xlAscending,

    Header:=xlGuess,
    > _
    > OrderCustom:=2, MatchCase:=False, Orientation:=xlTopToBottom
    > Range("H6:H1000").Select
    > Selection.Font.ColorIndex = 10
    > Range("I6:I3000").Select
    > Selection.Font.ColorIndex = 41
    > Range("J6:J3000").Select
    > Selection.Font.ColorIndex = 13
    > Range("L6:L3000").Select
    > Selection.Font.ColorIndex = 3
    > Range("G4").Select
    >
    > End Sub
    >
    > When it's run the following message appears:
    >
    > 'Object library invalid or contains references to object definitions that
    > could not found'
    >
    > Anyone know how to fix this?
    >
    > Thank you
    > Pat
    >
    >




  3. #3
    Pat
    Guest

    Re: Error running macro


    > First, let's get rid of the selections. Now, could it be that you are
    > running on a sheet that does not have these ranges?


    I am puzzled by your question. Data is contained throughout the
    Range("G6:T1000")


    "Don Guillett" <[email protected]> wrote in message
    news:%[email protected]...
    > First, let's get rid of the selections. Now, could it be that you are
    > running on a sheet that does not have these ranges?
    >
    > Sub SortRef()
    > Range("G6:T1000").Sort Key1:=Range("G6"), Order1:=xlAscending,
    > Header:=xlGuess, _
    > OrderCustom:=2, MatchCase:=False, Orientation:=xlTopToBottom
    > Range("H6:H1000").Font.ColorIndex = 10
    > Range("I6:I3000").Font.ColorIndex = 41
    > Range("J6:J3000").Font.ColorIndex = 13
    > Range("L6:L3000").Font.ColorIndex = 3
    > End Sub
    >
    > --
    > Don Guillett
    > SalesAid Software
    > [email protected]
    > "Pat" <[email protected]> wrote in message
    > news:[email protected]...
    > > The following macro I run from a custom button on a custom toolbar:
    > >
    > > Sub SortRef()
    > >
    > > Range("G6:T1000").Select
    > > Selection.Sort Key1:=Range("G6"), Order1:=xlAscending,

    > Header:=xlGuess,
    > > _
    > > OrderCustom:=2, MatchCase:=False, Orientation:=xlTopToBottom
    > > Range("H6:H1000").Select
    > > Selection.Font.ColorIndex = 10
    > > Range("I6:I3000").Select
    > > Selection.Font.ColorIndex = 41
    > > Range("J6:J3000").Select
    > > Selection.Font.ColorIndex = 13
    > > Range("L6:L3000").Select
    > > Selection.Font.ColorIndex = 3
    > > Range("G4").Select
    > >
    > > End Sub
    > >
    > > When it's run the following message appears:
    > >
    > > 'Object library invalid or contains references to object definitions

    that
    > > could not found'
    > >
    > > Anyone know how to fix this?
    > >
    > > Thank you
    > > Pat
    > >
    > >

    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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