Thread: Error in code
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Error in code

Typo

If Len(Cells.Value) 7 Then

remove the s
Cell.Value

--
Regards Ron De Bruin
http://www.rondebruin.nl



"JOUIOUI" wrote in message ...
The purpose of this code is to scan the entire sheet and move all data
greater than 7 characters to Col H to column I. I get an error in the If
Len statement. Any ideas?

' If text great than 7 characters in column H move text to to I Column

Set rng = Range(Cells(2, "H"), Cells(Rows.Count, "H").End(xlUp))
For Each cell In rng
If Len(Cells.Value) 7 Then
cell.Offset(0, 1).Value = cell.Value
cell.ClearContents
End If
Next