View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Chet Chet is offline
external usenet poster
 
Posts: 88
Default How replace a character in a string of characters?

Hi Cath,
Thanks for your help! I should have mentioned my code is failing at
the Target = Left(Cells(rowy, 11), 1) line. It still is failing at
that point. Any other ideas? :)

Thx Chet

wrote:
Hi Chet,
try this revised version

Sub REMOVE_INVALID_DATA_PHX_DOWNLOAD()

MaxRow = ActiveSheet.Range("A65536").End(xlUp).Row

For rowy = 2 To MaxRow
Target = Left(Cells(rowy, 11), 1)
If Target = "=" Then
Cells(rowy, 11) = Mid(Cells(rowy, 11), 2)
End If
Next rowy

End Sub

I think your code was failing because you can only use the LEFT
function for reading a value not for writing.

Cath