Replace Words In A Given Range
Jan 5, 2010I'm trying to write some code that will make excel examine a particular range, determine if there is text in each cell, and if there is replace it with different text.
View 6 RepliesI'm trying to write some code that will make excel examine a particular range, determine if there is text in each cell, and if there is replace it with different text.
View 6 RepliesI have a column of words in Column A and I want to replace all the times that these words appear in the rest of the excel sheet with the words in Column B. If someone has already answered a similar problem link me to the thread because I can't find anything.
View 5 Replies View RelatedHow do you replace terms, such that if you replace 'alphabet' with:
alpha -> calcu
bet -> lator,
you get 'calculator'?
The one I'm asking is similar to: Replace("alphabet", "bet", "lator") = alphalator, though 'alpha' will get replaced as well.
I'm looking for a macro to remove all words (in a single word per cell format) in a range (approx 100 columns & 7000 rows), except for a list of 100 words.
I'd prefer to email the file if that's okay.
Trying to do:
Where ever "New Orleans Saints" shows up in my sheet. I want to replace it with "NO"
Where ever "Washington Redskins" shows up in my sheet. I want to replace it with "WAS"
.
.
.
This continues on for 32 different teams.
I have tried Sumproduct and Countif and can not get a proper count of rows that contain specific words in multiple columns. I have attached an example spreadsheet where I am looking for a result of 7 rows that contain 1 to 4 specific words within phrases. The example looks for the words: "virus", "spyware", "malware" & "adaware", and ignores any other words like "aware" or "ware".
View 7 Replies View RelatedIm hoping there is an Excel Formula (not VBA Code) solution to this problem.
I understand how to use the Substitute command in Excel, but I would like to be able to provide a list of words and have the Substitute command use that list to replace every occurrence within a given cell with a blank ("").
The twist to this is, that the List of Words will be Dynamic, and thus the formula will need to account for that.
NOTE: the formula should NOT replace parts of words, e.g., if the List Word is "can" and the cell to be evaluated contains "candle" the formula should NOT replace the "can" in "candle" with "". Only whole word matches should be replaced.
We have a list of typed information (see attached) in which we would like to remove some words and simply replace with a space "". In addition to this: Unfortunately, folks tend to mistype or misspell words, add extra digits, etc, and for those mistakes we would like to replace them with corrections. Therefore, for this problem, we have a Replacement Table and the Subject Data, an example of which is shown in the attachment. I have posted a slightly similar problem on Ozgrid recently:
Replace Words In Cell Matching Those In A List
and in that link, the following UDF was proposed:
Function ReplaceIfInList(rList As Range, rCell As Range, _
strReplacement As String) As String
Dim rLoop As Range
If rCell = "" Then Exit Function
For Each rLoop In rList
If ReplaceIfInList = vbNullString Then
ReplaceIfInList = Replace(rCell, rLoop, strReplacement)
Else
ReplaceIfInList = Replace(ReplaceIfInList, rLoop, strReplacement)
End If
Next rLoop
End Function
This worked great, but at the time i posted this, I did not have the foresight to anticipate the flexibility in what the replacement text would be (the above code always replaces with a ""). THIS new Post is asking the following:
Is there a way to define (or modify the above) User Defined Formula that will analyze the words typed in a cell, which are typically separated by spaces (or on accident, multiple spaces), and essentially use the Replacement Table as a reference for what word to replace with?
how to accomplish more work quickly is proving difficult. I am making a word cloud of survey responses for my boss and he doesn't like to see similar words in the cloud (like Ease and Easy or even Fast and Quick). I have several hundred of these responses that are open ended answers that say one or many of these terms. Any way I can separate all the words and have them in one neat column? If I can get to that point, replacing those words will be simple enough.
View 2 Replies View RelatedI am using excel 2007. I have a worksheet with a list of words I wish to step through this list replacing the selected words in another workbook with nothing (ie deleting them).
I have the following code
Code:
Sub replacewords()
Dim MyWord As String
Dim wbLibrary As Workbook
Dim wbWorking As Workbook
Dim myExcelColumns As Integer
Dim myExcelRows As Integer
Dim MyRow As Integer
Dim MyRange As Range
[code].....
It does not seem to evaluate "myRange";
i need to look for two words along a range along a row. i need to know if only one of the words is found or if both are found. ie if apples or oranges or both are found in a range along one row.
I need a way to do the following in Excel:
column A has text
column B needs a Formula that returns specific value(s)
ie. want to find any of 17 specific strings within a row in column A and return that (those) string value(s) in column B
for example row1 column A contains the following:
Troubleshooter Notes: Sound KVSND Tree was not used as doc exists that covered the specific issue
The formula in column B needs to be able to find any of the following values (note: these values could be placed in a lookup table):
"KVBAT" "KVBLTH" "KVDNW" "KVDOC" "KVDWB" "KVFLSH" "KVKBD" "KVLAN" "KVODD" "KVOTH" "KVPFS" "KVRCVY" "KVSB2" "KVSFT" "KVSND" "KVVID" "KVWFI"
and place the found value(s) in row 1 column B
in the above example column B would return the value:.............
I have inherited an Excel workbook in which the formlas all contain cell names (and there are thousands of names in this book). I need to find a way to change from using cell names in a formula back to a standard absolute cell reference but have no idea how to do this?
View 9 Replies View RelatedHere is my dataset... with ( cell references):
(Cell A1): "John: Apples, Oranges, Grapes"
(Cell A2): "Sally: Oranges, Peaches, Grapes"
(Cell A3): "Tom: Apples, Peaches"
(Cell A4): "Bailey: Apples, Grapes"
How do I get the text above formatted to bold the individual's names? Here is my desired result:
(Cell A1): "John: Apples, Oranges, Grapes"
(Cell A2): "Sally: Oranges, Peaches, Grapes"
(Cell A3): "Tom: Apples, Peaches"
(Cell A4): "Bailey: Apples, Grapes"
how to do this with visual basic ( VB) code. I need VB instructions to be detailed.
I've got a list in "column A" of around 6000 lines which contains key words which I want to extract to "Column b" if It matches but it can match on more than one word .
e.g
List
Six Nations Ireland v England
FA cup Semi Final Chelsea v Liverpool @ Old Trafford
Criteria Sample
Ireland
England
Chelsea
Liverpool
Ideally I would like to extract the first Town/Country as this is where the event is held unless the @ symbol is used then it's the last Toen/Country as in the FA cup example.
I am trying to count words in seperate rows,columns in a spreadsheet. I have tried to use the formula that was suggested in one of the formula pages but I did not get the correct answer. I tried to do just like the information said with a1:a5. I did get 5 as an answer but when I deleted one of the words it still said there were 5 words.
View 4 Replies View RelatedI have a key-word, and I need to search a 90,000 words in a range where i should find several words that have 2, 3 or 4 letters of the first letter of the key-word, then find several words that have 2, 3 or 4 letters of the second letter of the key-word,
I've been using conventional method to do this and it's time consuming. I would like to total up 2 column. A multiply B to be exact. Below are some examples:
Table 1 - Before totaling up:
Quantity
Product
5
2 x Button A White
3
4 x Button B Pink
4
5 x Ribbon A Black
2
3 x Thread A White
6
2 x Cloth A Blue
Table 2 - After totaling up:
Quantity
Product
10
Button A White
12
Button B Pink
20
Ribbon A Black
6
Thread A White
12
Cloth A Blue
I need to have the sum of the "Quantity" multiply "Product". Or in short A x B.
And the end result need to have the number and "x" sign removed while keeping on the the products names. (2 x ) Take note it's "number" space "symbol" space.
I have a column with rows from 41:254, the first cell contains a word, and the next is blank, and this repeats the whole way down.
a previous macro i run changes one of the cells in the range (one of the ones containing a word) to a number value, i want to write a further macro to select this cell that has now changed. when it changes it will be the only cell in the range with a number in.
I am trying to find certain words in a column and delete the word and characters following. For example, Say I have a column of info as seen below. This is a test of me. I am just experimenting with this stuff. Deleted (6/15/01) Let me know what you think. I am not sure about it all, but I guess I will figure it out. riviledge1 (01/05/06) Now let's see what happens when I try to test it.
I want to find all the "Priviledge1 (01/05/06)" and replace with nothing. Please note, the date will change with each record, so I need to figure out how to tell Excel to find "Priviledge1", delete it and the date behind it. So I want to delete "Priviledge1" and the next 11 characters including the space.
On to the topic, I have all the US and Canadian states abbreviated (CO = Colorado, etc.) and was wondering if there is a way to make all of them convert to their respective names in one fell swoop instead of writing it in for each one, one at a time. Something along the lines where I can make, CO = Colorado, TX = Texas and then hit enter and all of the abbreviations would convert. Some kind of command.
View 2 Replies View RelatedI want to sort on number of words, i.e. if a cell contains 1 or 2 words etc, with the cells containing 1 word coming first then cells containing 2 words. Also, if possible, first the cells with fewer characters.
View 9 Replies View RelatedI have 4-5 separate lists of words/letters and I would like to combine them in a certain order but creating all possible combinations resulting a new word. It's like a conjugation tool for verbs. For example if List 1 = be/el/ki/meg; List 2= m List3=e/é; List4= gy/" "; List 5=" "/ek/sz/nnek So the output has to be (if the order is List1+List2+List3+List4+List5)= bemegy/bemegyek/bemegysz/bemesz/bemész/elmegy/elmennek/ ..... and all possible combinations.
Preferentially I would like to automate it in a way that it straight outputs into MS Access. Also can it be automated that it reads the list from a file (database)?
(Also can it recognize the word by letters? Because the basic word that I would load the program= List2+List3+List4)
I'm trying to do a quick find and replace across a range of cells to remove Chr(10) and Chr(13) characters. For some strange reason, some of the cells are being good and duly allow the removal of said characters and some are not - they stubbornly refuse to remove with no error message. The ones that are not allow removal if I copy the individual cell to a new sheet.
Sub removeCharNew()
'Dim x As Integer
Cells(1, 1).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Cells.Replace Chr(10), ""
Cells.Replace Chr(13), ""
End Sub
I have a list that looks like the list on my sample file. You will see ME28A16 at the top and the bottom of the list. I want to fill the Cells inbetween with that value. In my real file It may start ME or it may start PE
Here is the Script that I am using but I can not get it to work:
Dim CurrentRow As Long
Dim LastRow As Long
Dim CurrentText
LastRow = Range("A65000").End(xlUp).Row
For CurrentRow = 1 To LastRow
If InStr(4, Cells(CurrentRow, 4).Value, "M", vbTextCompare) > 0 Or _
InStr(4, Cells(CurrentRow, 4).Value, "P", vbTextCompare) > 0 Then
CurrentText = Cells(CurrentRow, 4).Value
Else
Cells(CurrentRow, 4).Value = CurrentText
End If
Next CurrentRow
How to find and replace a range of values. I've looked online, and searched the forum with no success.
I have a list of cells in a column labled "Check #1", "Check #2", "Check #3" ect. I'm trying to build a Macro that would replace any value from "Check #1" to "Check #50,000" with "Outgoing Check". I know this can be done manually with relative ease, but it will need to be done very very very often, so I'd like to automatic it as much as possible.
How to put the steps into a Macro or Formula that could be re-produced with ease.
I would like to use some vba code to search range T3 to U500
and search for the word "all out" which will appear within the text of some cells - in the format :-
64 all out(36 overs)
and replace it to
64 all out(50 overs)
the two digit total at the beginning of the line can be 1-3 digits and the number of overs can only be 1 or 2.
I am looking to Find and Replace (via ctr-F) but I need to replace it only within a range of selected cells. Each time I try to do this it replaces everything even though I have tried selecting each cell and replacing only that. Is there a way to select a certain amount of cells and replace?
View 2 Replies View RelatedMy data set consists of 10,000 rows and 5,000 columns. I want to search the Used Range and replace all cells which say "NaN" and make them blank.
Any code i currently use takes way too long.
I'd like to Find and replace blank cells in columns O and P, with the word "BLANK CELL" but only = to lowest data row in col D and then stop.
View 2 Replies View Related