Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Sep 17, 3:06*pm, "Bob Phillips" wrote:
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.- Hide quoted text - - Show quoted text - Dear can't we define it as a dynamic name in sheet and use that name in code instead of range?? Thx. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Problem using obj.Namespace(sourceFileName) Namespace(DestinationFilename).Itemsand then opening the xls file which creates a Temp Folder inside Temp | Excel Discussion (Misc queries) | |||
Defined named range (Array list) | Excel Programming | |||
Recently Used File List - 2002 Contains 'Temp' Files | Excel Discussion (Misc queries) | |||
Cant Select temp Sheet | Excel Programming | |||
Copying Temp List to cell | Excel Programming |