Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default Help with Replace()

Rick,

Clever! I was either blind or VBA Replace() was not operating as documented.
I am not blind.

EagleOne

"Rick Rothstein" wrote:

Replace is an odd function (in my view) in that if you specify a starting
position to do the replacement at, then it returns a substring starting at
that position before making the substitution (see the Remarks section for
the Replace function). So, to do the replace and keep the front part of the
string, you will need to concatenate it back together...

Position = 16
AfterReplacement = Left(StrToSearch, Position - 1) & Replace(StrToSearch, _
StrToFind, "", Position, , vbTextCompare)

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and Replace - Replace with Blank Space Studebaker Excel Discussion (Misc queries) 4 April 3rd 23 10:55 AM
Error for a replace. It replace ALL instead of selected column Mathieu Excel Programming 2 October 27th 08 05:19 PM
Can I replace a ' at the beginning of a text cell using Replace Hilde Excel Discussion (Misc queries) 4 September 10th 07 06:22 PM
How to Replace multiple words to replace using excell ramsun Excel Programming 1 August 10th 06 01:52 PM
find and replace - replace data in rows to separated by commas msdker Excel Worksheet Functions 1 April 15th 06 01:00 AM


All times are GMT +1. The time now is 02:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"