View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default problem with replace command

Try

Sub ReplaceData()
Dim x As Long
For x = 2 To 40000
Cells(x, 25).Value = Replace(Cells(x, 25).Value, "FALSE",
"FAL")
Next x
End Sub




--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"ruchie" wrote in message
ups.com...
in this macro i am trying to find and replace data in the rows
of a
particular column (25th). can someone guide me where im going
wrong?

Sub ReplaceData()
Dim x As Integer
For x = 2 To 40000
Cells(x, 25).Select
cell.Value = Replace(cell.Value, "FALSE", "FAL")

Next x
End Sub



this code gives an overflow error