View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Scott Wagner Scott Wagner is offline
external usenet poster
 
Posts: 82
Default VBA - Code failing in Excel 97

The following code is failing when users run in excel 97 on the "Replace" item.

Can you help?

Thanks in advance,

Scott

'----------------------------------------------------
'Remove unneeded text in column G
'----------------------------------------------------
Range("G2:G2000").Select
Dim Keywords As Variant
Dim Rng As Range
Dim Ndx As Long
Keywords = Array("Q Line ", "120 VAC ", "- Breaker ", " Standard")
For Each Rng In Selection.Cells
For Ndx = LBound(Keywords) To UBound(Keywords)
Rng.Value = Replace(Rng.Text, Keywords(Ndx), "")
Next Ndx
Next Rng