View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_3_] Bob Phillips[_3_] is offline
external usenet poster
 
Posts: 2,420
Default Array as defined list in sheet 'Temp'..

Dim OldWords As Range
Dim NewWords As Range

Set OldWords = Range("A2:A14")
Set NewWords = Range("H5:H17")
For i = 1 To OldWords.Cells.Count

NewWords.Cells(i, 1).Copy OldWords.Cells(i, 1)
Next i

etc.

--
__________________________________
HTH

Bob

"Sinner" wrote in message
...
Hi,

I would appreciate any help if I can use oldwords & newwords array
list as a defined range in another worksheet 'Temp'.
This way it would be flexible to change the values in sheet rather
than in code.
--------------------------------------
Sub ReplaceAll()
OldWords = Array("value1, value2,.........value(n)")
NewWords = Array("value1, value2,.........value(n)")

For i = LBound(OldWords) To UBound(OldWords)
Cells.Replace OldWords(i), NewWords(i)
Next i

End Sub
-------------------------------------

Thx.