Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Pat Pat is offline
external usenet poster
 
Posts: 122
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default 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

"Pat" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
Pat Pat is offline
external usenet poster
 
Posts: 122
Default 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" wrote in message
...
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

"Pat" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error 400 when running Macro Jim@Tech Excel Discussion (Misc queries) 3 October 20th 08 05:35 PM
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Worksheet Functions 1 May 3rd 08 02:35 PM
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Discussion (Misc queries) 1 May 3rd 08 10:52 AM
Error Running a Macro viddom Excel Discussion (Misc queries) 3 July 28th 05 01:56 PM
Error when running macro Rob Excel Programming 2 December 9th 04 07:20 AM


All times are GMT +1. The time now is 12:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"