excel vba - VBA replace multiple strings from a separate list -


I need to change STRINGS but so far I have been able to change words only. The code is going through the details column and it is going to change every sequence from the list.

Instead of using full words ( old values ​​), use the abbreviation ( new value ) each time a neighbor (no place) Character etc., the code fails. what is wrong? Thanks!

  SubRespace word_BUT_Need_ToReplaceStrings () application.ScreenUpdating = False 'This macro works with different words only remove hyphens etc. before applying this macro. Range in the form of mandaroo, as a range dim c1 worksheet, in the form of s2 worksheet, integer as the last line, in the form of v string, j as integer, old as string, string Newv string as LastRow = Room (Rows, "A"). (XlUp). S1 = Set Sheets ("JE_data") Set s2 = Sheets ("ListToReplace") Set A = s1.Range ("J: J"). Chambers Special call (xlCellTypeConstants) for each R for a = v = R.Value for last 2 = 2 = j2 = C2 (2) .csells (j, 1) .text newv = s2.Cells (j, 2) .text  

'Change the function as you' I used it case sensitive. 'Are you certain that all your invoices begin with capital letters? 'If not, replace OK v = instead of (v, oldv, newv, 1, -1, vbTextCompare) function. V = change (v, oldv, newv, 1, -1, vbTextCompare) v = replace (v, oldv, newv) next j r.Value = trim (v) next r application Example:

place for the listing

  left column ( Old) right column (new) ---------------------------------------- Invoice income pay C credit no.  

JE_data

  note note NY / 2712/14 RF / 022 9/14 Invoice 1078 10 TECHNOQ01SI 2014 03288  

( Editor's note: I do not know that the example is right because this comment

was replaced with cr and invoice inv Code> but it was not

Change the function as you have used This case is sensitive is. Are you certain that all your invoices begin with capital letters? If not, change

  v = (v, oldv, newv, 1, -1, vbTextCompare)  

instead of the function.


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -