Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Code Works Fine in Excel 2007, Excel 2000 generates Runtime Error 438

I run this code in Excel 2007 and also saved it as Excel 97/2003 on my
computer, both the .xls and .xlsm worked fine. When I go to a
computer that has Excel 2000 I get a "Runtime Error 438, Object
doesn't support the property or method". Debug sends me to this line:

ActiveWorkbook.Worksheets("Master").Sort.SortField s.Clear

Does this not work in Excel 2000?


'Clear contents of monthly data for refreshing
Range("A5:J1000").Select
Selection.ClearContents



'Copy data from all worksheets starting in cell A5 to master tab
Dim sht As Worksheet
Dim target As Worksheet
Dim rng As Range
Dim targetrng As Range

'You can change "Master" to your exact merge sheet name (tab
name for the sheet)
Set target = ActiveWorkbook.Worksheets("Master")
For Each sht In ActiveWorkbook.Worksheets
If Not sht.Name = target.Name Then
'Set rng = sht.UsedRange
Set rng = sht.Range("a5:J500")
Set targetrng = target.Cells(65536, 1).End(xlUp).Offset(5)
rng.Copy targetrng
End If
Next sht

Range("A5:J500").Select



'Run sort routine by date on list
ActiveWorkbook.Worksheets("Master").Sort.SortField s.Clear
ActiveWorkbook.Worksheets("Master").Sort.SortField s.Add Key:=Range
("A5:A500") _
, SortOn:=xlSortOnValues, Order:=xlAscending,
DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Master").Sort
.SetRange Range("A5:J500")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With

Dim c As Range, compdate As Date
compdate = Range("A1").Value




If IsDate(compdate) Then
For Each c In Range("A5:A500", Range("K65536").End(xlUp))
If IsDate(c.Value) And c.Value compdate Then
c.EntireRow.Delete
End If
Next

End If
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
Find function for a Range failing in excel 2003 and giving subscriptout of range error 9 problem but works fine in excel 2000 Prince Excel Programming 5 February 10th 09 05:47 PM
VBA code for excel 2000 no longer works in excel 2007 Blaine[_3_] Excel Programming 8 October 4th 08 01:45 PM
Excel 2000 clocks -- Excel 2003 works fine. Arne M. Wiechmann Excel Programming 0 February 16th 08 12:12 AM
xls file works fine in Excel 2000 and 2007 but crashes on opening in 2003 gromit12 Excel Discussion (Misc queries) 2 November 6th 07 09:30 PM
Pivot table is not valid in Excel 2000 but works fine in EXCEL 200 Ulrik Loves Horses Excel Discussion (Misc queries) 1 December 18th 06 03:08 PM


All times are GMT +1. The time now is 04:22 AM.

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

About Us

"It's about Microsoft Excel"