View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default erasing space/blank in a cell

Sub TRIM_EXTRA_SPACES()
Dim Cell As Range
For Each Cell In Selection
If (Not IsEmpty(Cell)) And _
Not Application.IsNumber(Cell.Value) And _
InStr(Cell.Formula, "=") = 0 _
Then Cell.Value = Application.Trim(Cell.Value)
Next
End Sub


Gord Dibben MS Excel MVP

On Thu, 15 Jan 2009 06:17:08 -0800 (PST), thread wrote:

Hi
i'm doing alot of vlookup work and very common to facea problem in
linking becaouse of additional space or blank line
does anyone have an idea how can it be overcomed?