Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Substitute Respective Entries In Arrays
I often come across to make several changes in long data columns. Find &
Replace would completely make the changes but in a final form. Could any of you experts please help me in designing a UDF so as to make all the characters/combinations of the same, as inserted in one array, be replaced with the respective entries in another. Example is as below: The Data Column is like: First Second Third Fourth First Array has entries like: ir s d Second Array has respective entries as follows: aa bb cc What sort of UDF would, when applied upon the data, would lead to the following result: Faabbt bbeconcc Thaacc Fourth I have tried the following code but can't seem to figure out a proper looping so as to refer to the entries in the second range: Function TEXTCLEAN(Str1 As String, r1 As Range, r2 As Range) As String Dim myC As Range TEXTCLEAN = Str1 For Each myC In r1 TEXTCLEAN = Replace(TEXTCLEAN, myC.Value, <<How 2 refer r2?) Next myC TEXTCLEAN = Application.WorksheetFunction.Trim(TXTCLN) End Function Thanx in advance. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
When i am at a cell, how can i highlight respective row and column | Excel Discussion (Misc queries) | |||
IF + respective Validation Dropdown List | Excel Worksheet Functions | |||
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE.... max. limit 8 :( | Excel Discussion (Misc queries) | |||
Looking up data in a column, then returning values of respective row | Excel Discussion (Misc queries) | |||
In Bar Chart, can we display both figures and their respective %a. | Excel Discussion (Misc queries) |