Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Debug Error | Excel Discussion (Misc queries) | |||
Debug Error | Excel Discussion (Misc queries) | |||
debug error | Excel Programming | |||
down with the debug error | Excel Programming | |||
Debug Error | Excel Programming |