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

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.misc
external usenet poster
 
Posts: 1
Default Debug Error in Code

Hi Karen

I've had similar problems when i was using a macro that originated from 2003
on XP. I removed the SearchFormat:=False part of the macro and it worked
fine on both versions of excel.
Hope this helps.

"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



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Debug Error in Code

Check your other post, too.

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
error in this code [email protected] Excel Worksheet Functions 2 December 5th 06 05:21 AM
Code Error Tom Excel Discussion (Misc queries) 0 February 21st 06 03:01 PM
How do I resolve debug error macro Excel 2000? At least, any lead Excel 2000 Macros debugger Excel Discussion (Misc queries) 5 October 25th 05 08:56 AM
Error Code 481 MBlake Excel Discussion (Misc queries) 1 May 11th 05 01:27 PM
Code error ?? Anthony Excel Discussion (Misc queries) 2 February 9th 05 10:31 PM


All times are GMT +1. The time now is 09:42 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"