LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
bl bl is offline
external usenet poster
 
Posts: 7
Default Application-defined or Object-defined error

Dear all,

I am puzzled in the following situtations. There are 2 worksheets in the
workbook, one for user menu and the other is the data. I would like to do
some sorting in the data. As a result, I write down the following in the
"UserMenu" worksheet.

Sub Test2()
Sheets("Data").Select
ActiveSheet.Range(Cells(Firstrow, 1), Cells(Lastrow, 19)).Select
Selection.Sort key1:=Range("R10")
End Sub

However, the coding got the error message "Run-time error 1004 -
Application-defined or Object-defined error"

However, if I paste the code into the "Data" sheet as follows :

Sub Test2()
ActiveSheet.Range(Cells(Firstrow, 1), Cells(Lastrow, 19)).Select
Selection.Sort key1:=Range("R10")
End Sub

The code can be executed without any problem. What is the reason for the
problem and your help will be much appreciated.

BL


 
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
Run-time error '50290': Application-defined or object-defined erro Macro button Excel Discussion (Misc queries) 1 March 12th 09 10:59 AM
Application-Defined or Object-Defined Error on simple code [email protected] Excel Programming 6 February 22nd 05 09:03 PM
Application-defined or object-defined error on copy Josh Sale Excel Programming 1 February 3rd 05 01:40 AM
Application-defined or object-defined error - missing the basics [email protected] Excel Programming 1 December 28th 04 10:23 PM
Macro Run-time Error 1004 Application Defined or Object Defined Error Anddmx Excel Programming 6 June 9th 04 03:40 PM


All times are GMT +1. The time now is 06:13 AM.

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"