Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Code to do complete a Find and Replace on long list of values

Hello - I have a pretty straightforward set of steps that I was hoping someone could help me write a macro for.

The content includes:
(1) a list of alphanumeric values in Sheet1, columnA (the range is variable, and can be as many as several hundred thousand values).
(2) A series of phrases to Find and Replace in Sheet 2, located in columns A and B (i.e., column A is the 'Find value' and column B is the 'Replace' value
(3) In some instances the goal is to Replace the value with nothing at all (i.e., to delete those characters wherever they exist in Sheet1!A:A), so in that case there is no value in the adjacent cell in column B of Sheet2.

The list of steps is as follows:
1. Begin with Sheet2!A2. Find this value in any part of a cell in the list of data in Sheet1!Column A (many instances will exist). Replace those Values with Sheet2!B2. Now just move down the list.
2. Move to sheet2!A3 (i.e., move down 1 cell). Find this value in any part of a cell in the list of data in Sheet1!Column A (many instances will exist). Replace those Values with Sheet2!C2.
Etc.
3. Eventually there will be no more values to look up in Sheet2, column A.

(note that in some instances there will be no value in column B of sheet 2, so if it is easy enough, the macro could simple "Delete" that value since it will be replacing the selection with "nothing".

Here is a simple example:

Sheet2!Column A Sheet2!ColumnB
apple orange

If any cell in Sheet1!A:A contains a value with "apple" it would be replaced with "orange:. So if Sheet1!A243 contains the value "apple juice" initially, it would read "orange juice" after the routine is complete.

Thanks for any help you can provide!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Code to do complete a Find and Replace on long list of values

Hi Fred,

Am Fri, 19 Jun 2015 07:41:19 -0700 (PDT) schrieb James:

Hello - I have a pretty straightforward set of steps that I was hoping someone could help me write a macro for.


I answered in the other group


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
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
Excel - Find and Replace function takes a long time Chris Excel Discussion (Misc queries) 2 October 1st 09 07:58 PM
Replace html code - formula too long andy62 Excel Discussion (Misc queries) 1 February 24th 09 09:48 PM
my excel formulas are too long to execute find and replace jmh33 Excel Worksheet Functions 1 February 22nd 06 05:35 PM
Replace a long list of abbreviations with full words in Excel jgundel Excel Worksheet Functions 3 February 7th 06 07:11 PM
Long list of words to find with Filter englishtwit Excel Discussion (Misc queries) 2 July 29th 05 08:48 AM


All times are GMT +1. The time now is 11:00 PM.

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"