VBA - Code failing in Excel 97

G

Guest

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
 
D

Dave Peterson

Replace was added in xl2k.

In xl97, you could use application.substitute().
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top