Problem in WITH/END WITH code snippet

  • Thread starter Thread starter Hash
  • Start date Start date
H

Hash

Gang -

In set range r this code works:

With r
.formula = .value
End With

This doesn't:

With r
.formula = vba.replace(.value,chr(160),chr(32),1)
End With

What am I missing?

Thanks in advance.
....best, Hash
 
Is this what you want?

For Each cell In r
cell.Value = Replace(cell.Value, chr(160), chr(32), 1)
Next
 
Back
Top