#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Debug Error

I have the following code which works fine when I import information into a
spreadsheet on my PC but which creates run time errors when replacing Overall
Result with "" when used by someone else. I think we are working on
different versions of Excel. Is there some modification of the code required
for it to run in versions earlier than 2003?

Private Sub Worksheet_Change(ByVal Target As Range)


Columns("A:A").Select
Selection.Replace What:="Overall Result", Replacement:="", LookAt:=xlPart _
, SearchOrder:=xlByColumns, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A65536").End(xlUp).Select
ActiveCell.Offset(1, 0).Select
Target.EntireColumn.AutoFit

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Debug Error

SearchFormat and ReplaceFormat were added in xl2002.

Remove them and it should work ok.

Karen McKenzie wrote:

I have the following code which works fine when I import information into a
spreadsheet on my PC but which creates run time errors when replacing Overall
Result with "" when used by someone else. I think we are working on
different versions of Excel. Is there some modification of the code required
for it to run in versions earlier than 2003?

Private Sub Worksheet_Change(ByVal Target As Range)

Columns("A:A").Select
Selection.Replace What:="Overall Result", Replacement:="", LookAt:=xlPart _
, SearchOrder:=xlByColumns, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A65536").End(xlUp).Select
ActiveCell.Offset(1, 0).Select
Target.EntireColumn.AutoFit

End Sub


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Debug Error

Great, thanks I knew it would be something simple!

"Dave Peterson" wrote:

SearchFormat and ReplaceFormat were added in xl2002.

Remove them and it should work ok.

Karen McKenzie wrote:

I have the following code which works fine when I import information into a
spreadsheet on my PC but which creates run time errors when replacing Overall
Result with "" when used by someone else. I think we are working on
different versions of Excel. Is there some modification of the code required
for it to run in versions earlier than 2003?

Private Sub Worksheet_Change(ByVal Target As Range)

Columns("A:A").Select
Selection.Replace What:="Overall Result", Replacement:="", LookAt:=xlPart _
, SearchOrder:=xlByColumns, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A65536").End(xlUp).Select
ActiveCell.Offset(1, 0).Select
Target.EntireColumn.AutoFit

End Sub


--

Dave Peterson

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
Debug Error Ed Davis Excel Discussion (Misc queries) 7 June 16th 09 03:10 PM
Debug Error Saxman Excel Discussion (Misc queries) 3 August 11th 08 12:42 PM
debug error [email protected] Excel Programming 0 March 28th 05 10:46 PM
down with the debug error hurlbut777 Excel Programming 1 January 8th 05 12:08 AM
Debug Error Todd Huttenstine[_2_] Excel Programming 3 December 26th 03 11:46 PM


All times are GMT +1. The time now is 01:34 PM.

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"