View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
JLatham JLatham is offline
external usenet poster
 
Posts: 3,365
Default Selecting used cells only in the workbook

Try this instead of your Cells.Select statement:

Range("A1").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select

While this may select some unused cells, it won't select all except under
special circumstances (you've put something over in IV65536 in the past).
Should show some improvement.

"Sandeep" wrote:

Hi

I am using this code for mass replacing...
For Each wsSheet In Worksheets
wsSheet = Application.ActiveSheet
Cells.Select
Selection.Replace What:="*!", Replacement:="=", LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False,
SearchFormat:=False, _
ReplaceFormat:=False
Next wsSheet

Is it possible that instead of "Cells.Select" i can use only used cells in
the worksheet or even in the complete workbook to increase the performance??

Thanks,
Sandeep