Find If Text Cell Contains A String Of Characters From Array In Different Workbook
Aug 12, 2011
I've scoured the internet for this answer and have not found a formula that works.
I have a list of domain names/URLs in column A of workbook 1:
jhjh.com
hajfh.co.nz
123.123.12.12
I have a list of domain name extensions in workbook #2:
.com
.co.nz
.net
I want to determine if the cells in column A workbook one contain any of the strings in workbook 2 - note that I need to look at the string, not the entire cell in workbook one. If there is a match, true, if not, false for that cell within workbook one.
It's sort of a reverse array lookup with text. It seems that cross workbook and text is what causes the challenge.
View 9 Replies
ADVERTISEMENT
Nov 17, 2007
How I can change this formula to find the first 3 characters of a text string?
Instead of using numbers in column A, it will be Names, I need the user to enter only the first 3 characters of the name and then display the results, (Meaning that all others irrelaavnt rows will be hidden.
Sub myHidingRoutine()
Dim foundCell As Range
With ThisWorkbook.Sheets("Sheet1")
Set foundCell = .Range("a:a").Find(What:=.Range("a2").Value, After:=.Range("a2"), _
LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False)
View 9 Replies
View Related
Feb 9, 2013
The problem - I'm trying to find a formula that will find text between 2 characters with unlimited instances in a single string and combine the found text to a single string. The character enclosing the text i'm after will likely be a % symbol. This formula would then be replicated down 5000-10000 rows.
eg. 1 - This is %an% example %sentence% to show what I %am% looking for
eg. 2 - This %is another% example of what I %need%
eg. 1 answer - ansentenceam
eg. 2 answer - is anotherneed
Ideally this would not use a macro as it will be applied to an ever expanding data set but I realize that may not be possible.
View 3 Replies
View Related
Jul 30, 2012
in C a string is nothing more than an Array of characters ending with a null character.
in VBA this does not seem to be the case.I am trying to use the BlowFish code from David Midkiff for some encryption, however the code sometimes fails:
When encrypting a string a string of a specific length should be returned. however sometimes one of the characters of the encrypted string is a null character, and the returned encrypted string (with a embedded null character) is causing me problems. I want to check for the null character and if present redo the encryption. But how do I check for the presence of this null character in a unicode (double-byte) string?
Checking with Len(encrypted) gives the correct length (!) but trying to move each (unicode)character into an array fails when using the Mid() function past the null character in the string.
Now I can use
byteArray() = StrConv(unicodetext,vbFromUnicode)
to get the lower byte of each character into an array easily, but how do I do this for both bytes of the unicode characters?
Using an integer array does not work other than through
intArray(j) = CInt(AscW(Mid(Outp, j, 1)))
which fails on the nullstring in my encrypted text.
I have tried with variants but so far no luck. I thought if the string was entered into a variant then I could also address the variant as an array of bytes, but that does not seem to be accepted by VBA.
View 1 Replies
View Related
Mar 31, 2014
I am trying to do a sort of index match thing using VBA. What I am attempting to do is to use the prefix of a long number and try to find that exact prefix in a string array, and output that string array value. So this is what I have so far as a test:
[Code].....
So I can match the text exactly so if I put PREFIXB in cell A1 in this example, i will get the msg box saying "YES", but if I make it PREFIXB1231k4j3jj1kj32cj, it will display "NO". I want to get it so that PREFIXB will be displayed in the cell that I put the formula in. So if A1 = "PREFIX1AAA100CF" and cell B1 = "=ABC(A1)", cell B1 will display "PREFIX1AAA".
Now the thing is that these prefixes can have different lengths, but will never encompass the exact prefix of another. So if I had a prefix of: PRE1AB, I won't have a prefix of PRE1A.
View 2 Replies
View Related
May 23, 2006
I am having trouble getting my IF statement to test if the cell contains the text "sale" return "X" if not "Y". I need it to search through the text string in that cell and find a certain word, and if it finds that word, retrn a value. I am really having difficulty with is what symbol or function do I use for the logical test? (i.e. =, <>, MATCH, INDEX?)
View 4 Replies
View Related
Oct 15, 2012
I'm faced with receiving data for time, in a text format, as follows:
Example of possible cell contents...
20secs
40m20secs
2h40m20secs
I'm not interested in the secs value but need to isolate the h (hours) and m (mins) values to use in another formula as numbers. The time could be shown in either of the above formats with either; (a) just secs, (b) mins & secs or (c) hrs, mins & secs... and of course the hours or mins values could be 1 or 2 digits in length. How can I determine (using formula only, not vba) what the values for hours and/or mins are dependent upon what is present?
View 9 Replies
View Related
Feb 17, 2009
Sum every instance of [SPREAD]*[SIZE] where [NAME] occurs within a text string.
Please note, I'm trying to do this without creating a new column [SPREAD]*[SIZE].
View 11 Replies
View Related
Jul 11, 2014
Is it possible to find the location of different characters in a string (using VBA)? Normally I would use InStr of InStrRev option in VBA but my situation is a little more complicated.
The character I am looking for is not always the same, sometimes it is a , or a . or a : or a "blank" etc
I tried to do it like:
dim strChar as string
strChar = "[,.? /]"
SearchPosition = InStr ("cell location", strChar) (searchposition is the name of the function I am trying to make)
This works if I define only 1 character, this way it gives me a 0 as outcome
I have tried to change it to strChar = "[,]" or strChar = "[.]" or strChar = "[ ]" but this doesn't work.
View 13 Replies
View Related
Aug 27, 2007
I have text string and would like two formulas to find,
1) the characters after the last space and
2)to find the number of characters after the last space.
View 9 Replies
View Related
Aug 28, 2007
I have text string and would like two formulas to find, 1) the characters after the last space and 2)to find the number of characters after the last space.
View 9 Replies
View Related
Oct 20, 2012
I have a worksheet (WORK1) that contains two columns of values that I can add to or change if necessary. The first column would be a text string (STRING), the second column would be its category (CATEGORY).
Example:
STRING CATEGORY
Chevron Gas
Exxon Gas
Vons Groceries
McDonalds Hamburger
In a separate workbook (WORK2), I have a column (A) which contains text. Ex:
A1 = "Station 2134 Chevron Motor"
A2 = "ExxonOil 234"
A3 = "Vons store"
A4 = "Hamburger McDonalds"
I would like to assign B1, B2, and so on... a CATEGORY if it contains STRING.
For this example, B1, B2, and so on... would be assigned the values.
B1 = "Gas"
B2 = "Gas"
B3 = "Groceries"
B4 = "Hamburger"
View 5 Replies
View Related
May 3, 2013
I am trying to come up with a macro that will search a range for a specific string of text plus Interior.ColorIndex = 4. The range can have the text in it multiple times but i only want the macro to fire the next line of it if the cell address also has that color. Is there a way that can be done? My code below stops after it finds its first occurrence of the string and moves on to the next lookup. How do i make it look for not only the value but the index color?
View 5 Replies
View Related
Feb 20, 2008
I would like to find a text string in a document, move the information in the cell to the right of this to another cell (say A1).
View 8 Replies
View Related
Apr 3, 2009
I'm trying to pull text out of a middle of a long string of data located within one cell. The string is not always the same size and the text I need to pull out is not always in the same spot
For example - in this string
source=google&adgroup=Jimmy Bop (Broad) >>/yes/klingon/GetStarted.aspx >>/finace/success.aspx?
I want to pull out the text "Jimmy Bop (Broad)
It will always be between "adgroup=" and ">>/" (although sometimes the character ">>/" will appear multiple times within the string.
View 9 Replies
View Related
Dec 14, 2013
I have the data string below:
Career:25: 1-0-2 $13,765
I would like to extract the 1 between the : and - and as a seperate extraction would like te 2 between the - and the $ I have tried a few things but end up with the - as the length of the data changes
View 5 Replies
View Related
Sep 8, 2009
Is there an Excel function that can strip a specificed unwanted character from a text string to leave all the other characters excluding the unwanted one?
e.g. if the original text strings were (in separate cells within a workbook):
C-2C-9C-9-XA-10A-10-BA-10-XA-8N-7-D
The function would strip the "-" to leave:
C2
C9
C9X
A10
A10B
A10X
A8
N7D ...etc.
View 9 Replies
View Related
Aug 24, 2006
If 'a' is a string that contains x number of characters, how do I find out what x is (in VBA)?
View 2 Replies
View Related
May 5, 2012
I am trying to loop through column A and I want to store in an array where I find "App" within the cell value. I am trying to find "App" but will store the whole cell value in the array. I could not figure out the Find method, so I tried the MID function but am having no luck.
Here is my code:
Code:
Sub Arraytest()
Dim arr As Variant, lastrow As Long, i As Long, f As Long, l As Long
f = 0
lastrow = Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row
ReDim arr(1 To 1, 1 To lastrow)
[Code] .....
View 1 Replies
View Related
Mar 16, 2013
I am trying to simplify process for the users of a workbook. This workbook has about 20 tabs and I would like the users to manually paste a value in C1 of sheet1 and have a macro button that will find that value in the whole workbook.
View 3 Replies
View Related
Jun 30, 2014
I have a long list of terms, and I need to identify which of these terms appear in another body of text strings. Rather than searching for each individual term, is there a formula that check the terms for me automatically.
The terms will appear in the larger body of text, but they won't appear on their own, so they won't be perfect matches.
I've attached a sheet to try to illustrate the problem.
Term Checker.xls
View 5 Replies
View Related
Jul 13, 2012
There is a method to use ROW(1:10) within an array formula to strip a string into individual elements e.g.
HELLO > {"H","E","L","L","O"}
I cannot find it anywhere, thought it was something like =MID(A1,ROW(1:10),1) but not yielding results.
View 4 Replies
View Related
Sep 19, 2006
I need to make a macro that will find text between "o/" and "/", remove hyphens from the text it found, and then add it to the end of the current cell contents.
I know how to add to the end of current cell contents, but cannot figure out how to grab text between certain characters or replace hyphens and replace with spaces.
View 3 Replies
View Related
Oct 24, 2012
I want to get only unique characters in a text. For ex. ozgrid.com. I should get ozgrid.cm (o is already came). another one. For ABCEABC the result will be ABCE. So I have written an UDF. Unfortunately there was "Argument is not optional" error in "UNIQUECHARS = Join(JoinT.Item)".
How could I get rid from this error and get my result?
Below is my code.
VB:
Public Function UNIQUECHARS(chtxt As String)
Dim c() As Variant
Dim JoinT As New Collection
Dim sp As String
cchtxt = Application.WorksheetFunction.Substitute(chtxt, " ", "")
[Code] ......
View 3 Replies
View Related
Jan 30, 2013
I haven't had the need to work with partial strings till now and having difficulty finding the right context in other threads. I need to put the first 4 characters of one cell into another cell. The line in the below code with the comment is the one I need. It's the only one where I need only part of what is in the cell.
It should be = the first four characters of cells(zRow, "A")
Code:
Dim LastRow As Long
Dim zRow As Long
Dim cRow as Long
LastRow = Sheets("Datasheet").Range("N65536").End(xlUp).Row
zRow = 1
cRow = 2
[Code] ......
View 1 Replies
View Related
Aug 15, 2013
So, using an array under the Names column, search the string under combined names and break apart as illustrated. Must stay on the same line...w/o VBA.
Combined Name(A)
Names(B)
LeftofName(C)
[Code].....
View 1 Replies
View Related
Mar 8, 2013
How do I use an Excel formula to find which (if any) multiple sets, each of up to 50 words, exist in a series of rows of a spreadsheet - if set A has one or more words found in a searched cell.
A positive result will return a specific value in the designated result cell. If none of the words in Set A is found in the searched cell, the formulae will repeat the test for the words in Set B, and so on.
After all 50 sets of words have been tested, the formula will move to the next cell in the searched column.
New words will be added to the sets of words continually as required.
Multiple words within sets are included in double quotes. Within each set of words there will be some n-tuples of words (i.e. 24 adjacent words) that contain one or more of the words in the set, but for which the formula will be required to return a negative result. Example: Set A = word 1, word2, word 3, "word1 word2 word3". (The words within a set could also be each entered in separate columns, as opposed to all included in a single cell.) The single column of text to be searched is about 10,000 rows.
I am wanting to use the above in a spreadsheet that contains data downloaded from a series of bank accounts to automatically allocate items of expenditure to one of 20 or so different categories of expenditure.
The formula will search the description field to find words that are used in the in the downloaded files from the various accounts to describe each transaction.
If a word describing travel expenditure (e.g. hotel, "holiday inn" but not "holiday travel") is found in the description of an expenditure item - the item cost will be allocated to the TRAVEL EXPENDITURE column, which is one of 20 or so different categories of expenditure.
Happy to consider a different solution if the task can be done better a different way.
Tried using a combination of INDEX/SEARCH/IF in Excel, but was not able to get a correct result. PS I am using Excel 2011 for Mac - which does not allow macros, so the solution needs to be entirely formula based.
View 1 Replies
View Related
Jun 16, 2009
The following line finds last "non-blank" row in a column. I have a column that has formulas in 10000 rows. Most of the time only first 7000 rows will have data, other cells below will have "". I need to find the last row with real data, not "".
Is there a way to add a condition or check to the following line?
View 6 Replies
View Related
Jan 3, 2008
I have the following string of text and want to take out certain parts of it. Assume the string is in cell A1.
In cell B1 I want "Company ABC DEF"
In cell C1 I want "10.50%"
In cell D1 I want "12/13/2014"
String:
Company ABC DEF (USD) 10.50% 12/13/2014
how the MID formulas work (as a bonus)? I used =MID(A1,FIND(")",A1,1)+2,45) and it returns "10.50% 12/13/2014".
So I see that that formula says start from 1 character after ")", count 2 over, and then put in the next 45 characters. How do I do an in between amount, and how do I just have it come from the LEFT but stop when it finds " ("
View 9 Replies
View Related
May 22, 2006
I have this page in html. How to find the value 1 and 4 in:
<td WIDTH="25%" ALIGN="center"><font style="font-family: Verdana,
Arial, Helvetica, sans-serif; font-size: 10px; font-weight:
bold"> Pagine 1 di 4 </font></td>
and to find the value 308: <td align="center" colspan="11" class="INFO">Totale fidi individuati:308<br></td>. after store the value founded in var_1, var_4 and var_308. NOTE: in this case the value are 1, 4 and 308 but the contet of tag the value can change because the page is dinamic, in other case find the value after:
font-weight:bold"> Pagine now is 1
font-weight:bold"> Pagine 1 di now is 4
<td align="center" colspan="11" class="INFO">Totale fidi individuati:now is 308
View 2 Replies
View Related