Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Scott,
Off the top of my head, I think it's "Substitute" in 97. hth, Doug "Scott Wagner" wrote in message ... 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Replace was added in xl2k.
In xl97, you could use application.substitute(). Scott Wagner wrote: 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 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
code failing in hidden rows | Excel Discussion (Misc queries) | |||
Keyboards Shortcuts in Excel 2002 Failing to Work | Excel Discussion (Misc queries) | |||
Excel Macro Security Failing | Excel Discussion (Misc queries) | |||
Excel Copy Method Failing. | Excel Programming | |||
Excel 2000 Macro failing in Excel 2002 | Excel Programming |