View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Pat Pat is offline
external usenet poster
 
Posts: 122
Default Code stops at range

I don't understand why you open another workbook in the middle. Could you
explain exactly what you are trying to do?


The PForm.xls workbook will be saved as .csv file
Here is the remainder of the code:

LastRow = ActiveSheet.UsedRange.Rows.Count
Range(Cells(LastRow + 1, 1), Cells(LastRow + 200, 1)).Select
Selection.EntireRow.Delete

ActiveWorkbook.SaveAs Filename:= _
"C:\HLSexcel\RHLS.csv", _
FileFormat:=xlCSV, CreateBackup:=False
'"\\office\shareddocs\My Documents\Excel books 2005\RHLS.csv", _
'FileFormat:=xlCSV, CreateBackup:=False
Application.DisplayAlerts = True

Windows("Management.xls").Activate
Range("G8").Select

Pat



"Bob Phillips" wrote in message
...
Pat,

I have just tested this and I don't get the crash.

I don't understand why you open another workbook in the middle. Could you
explain exactly what you are trying to do?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Pat" wrote in message
...
Why does the following code stop running when it reaches
Range("A1:A1000").Select





Application.DisplayAlerts = False

Range("D8:J900").Select
Selection.Copy
Application.DisplayAlerts = False
Workbooks.Open Filename:= _
"\\office\shareddocs\My Documents\Excel books 2005\PForm.xls"
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,

SkipBlanks:=
_
False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="0", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Range("A1:A1000").Select
Selection.Replace What:="2", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False


Thank you if can help.
Pat