View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Radhakrishna k.v.n.r[_2_] Radhakrishna k.v.n.r[_2_] is offline
external usenet poster
 
Posts: 11
Default Problem of selection.delete

Thank you very much.

"OssieMac" wrote:

Now that I know the range you are trying to delete, my first thoughts are
that the memory of the computer cannot handle it. Perhaps some of the
computers have more spare resources than others. (xl2207 is designed to
handle a great deal more data.)

Personally I would use something like the following instead of trying to
select almost the entire worksheet. It finds the cell where the last used
column and last used row intersect. Also I would avoid using Delete unless
there is a real reason to do so.

Sub Last_Used_Cell()

Dim rngLastUsed As Range

With ActiveSheet.UsedRange
Set rngLastUsed = .Cells(.Rows.Count, .Columns.Count)
End With

Range("A4", rngLastUsed).Select

End Sub


Regards,

OssieMac