Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
deutz wrote:
I am using Excel 2003 I have a sheet that has in column A some long strings and I want a quick way, preferably without looping, to replace some characters with another character. The problem I have run into is that when I use Replace in VBA it is only applied to cells with no more than 1024 characters and so I tried using Substitute but that crashes if there is more than 1271 characters in a cell so I don't know how to process these long strings quickly. I tried the following and hit the limits mentioned above: If the Replace function is in 2003, you can do this: Selection.Value = Replace(Selection.Value, strOld, strNew) In 2007 it works for me with a 32,768-character string. (I didn't test it further than that.) If the Replace function is *not* in 2003, you can use Split and Join: Selection.Value = Join(Split(Selection.Value, strOld), strNew) Also works for me with the same 32,768-character string. I *believe* it should work as far back as Excel 2000. -- - Good lord! - He's not in. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Replace and Substitute Functions | Excel Programming | |||
wildcards with substitute of replace | Excel Programming | |||
Replace/substitute | Excel Programming | |||
Substitute/Replace | Charts and Charting in Excel | |||
Looking for a site with functions that substitute the ATP functions | Excel Worksheet Functions |