View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Keith74 Keith74 is offline
external usenet poster
 
Posts: 120
Default HELP...anybody got any ideas why this is running so slowly......


Whether is sub or function, this should help

'======================================
Private Function TrimAll(myTrimArea As Range)
Dim cell

application.screenupdating = false
For Each cell In myTrimArea.Cells
cell.Value = Trim(cell.Value)
Next cell

application.screenupdating = true
End Function


hth

Keith