Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Find and Replace

Hello,

The following text (or variation of it) is always in Cell H7 on a sheet
called "SetUp"
Some parts of this string are static, and others are updated as required.
I want to find and replace the text (which in this case is "FOODLIFE") with
other text.
The string "PRIMARY_VENDOR|^Method==|^2Val1=" is static, so if I can find
this, then replace whatever is after it, up until the beginning of the next
"|"


^1Enable=Y|^1Field=LOC_ID|^1Method==|^1Val1=41|^1W =V|^2Enable=Y|^2Optr=and|^2Field=PRIMARY_VENDOR|^2 Method==|^2Val1=FOODLIFE|^2W=V|^3Enable=Y|^3Optr=a nd|^3Field=BIN_1|^3Method=Starts|^3Val1=F|^4Enable =-|^4Optr=and|^4Field=DEPARTMENT|^4Method==|^4Val1=F ROZEN|^5Enable=-|^5Optr=and|^5Field=QTY_ON_HND|^5Method=<=|^5Val1= 0|^6Enable=-|^6Optr=and|^6Field=ITEM_NO|^6Method=Contains|^6Va l1=31863|^7Enable=-|^7Field=BRAND|^7Method=Contains|^8Enable=-|^9Enable=-|^10Enable=-|


Any ideas would be appreciated.

Thanks,

Ariel


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Find and Replace

=SUBSTITUTE(H7,LEFT(MID(H7,SEARCH(H8,H7)+LEN(H8),L EN(H7)),SEARCH("|",MID(H7,SEARCH(H8,H7)+LEN(H8),LE N(H7)))-1),H9)
where in my example H8 contains the static part
H9 contains the other text

Regards,
Stefi


€žAD€ ezt Ã*rta:

Hello,

The following text (or variation of it) is always in Cell H7 on a sheet
called "SetUp"
Some parts of this string are static, and others are updated as required.
I want to find and replace the text (which in this case is "FOODLIFE") with
other text.
The string "PRIMARY_VENDOR|^Method==|^2Val1=" is static, so if I can find
this, then replace whatever is after it, up until the beginning of the next
"|"


^1Enable=Y|^1Field=LOC_ID|^1Method==|^1Val1=41|^1W =V|^2Enable=Y|^2Optr=and|^2Field=PRIMARY_VENDOR|^2 Method==|^2Val1=FOODLIFE|^2W=V|^3Enable=Y|^3Optr=a nd|^3Field=BIN_1|^3Method=Starts|^3Val1=F|^4Enable =-|^4Optr=and|^4Field=DEPARTMENT|^4Method==|^4Val1=F ROZEN|^5Enable=-|^5Optr=and|^5Field=QTY_ON_HND|^5Method=<=|^5Val1= 0|^6Enable=-|^6Optr=and|^6Field=ITEM_NO|^6Method=Contains|^6Va l1=31863|^7Enable=-|^7Field=BRAND|^7Method=Contains|^8Enable=-|^9Enable=-|^10Enable=-|


Any ideas would be appreciated.

Thanks,

Ariel



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
Find/Replace Event or Find/Replace for Protected Sheet ... Joe HM Excel Programming 2 October 27th 07 03:55 PM
find and replace - replace data in rows to separated by commas msdker Excel Worksheet Functions 1 April 15th 06 01:00 AM
Using Find and Replace to replace " in a macro snail30152 Excel Programming 1 April 13th 06 11:58 PM
Replace method - cannot find any data to replace Mike Excel Programming 5 April 6th 06 08:56 PM


All times are GMT +1. The time now is 12:34 AM.

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

About Us

"It's about Microsoft Excel"