Vba instr wildcard I I am doing a simple search engine in excel and I want to make some wildcards, for example: I have a cell where the user input the search term (only numbers) which should look like this: "123456". Excel VBA - Check if cell contains specific Example #3 – Using the VBA InStr Function In this example, we will use the InStr function to search for the substring “sample” within the string “This is a sample text. For example, apply the bold format to only the word ‘Hello’ from ‘Hello World’. I have a VBA macro for Microsoft Word that I am trying to improve. Functions (Visual Basic for Applications) Support and feedback. I am trying to write a macro that will allow me to put the contents of the ActiveCell into a string and search that string for all occasions of a substring using wildcards. The purpose of the macro is to bold and italicize all words in a document that match the search terms in the first table of the document. Susan told Mike to go to the Zoo. If this is not the desired behavior and only want to match the exact phrase with nothing before or For example If Instr(String,"\****\") then The pattern-matching features allow you to use wildcard characters, character lists, or character ranges, in any combination, The more one uses VB6 the more "hidden" attributes of it one discovers, thanks largely to this Forum. Using a wildcard operator *, this code will find all values that start with Rep (so it covers both, Rep1 and Rep2). Name, "rectangle", vbTextCompare) > 0 Then This last version is not case sensitive, too Share. Property value. A group of one or more characters (charlist) enclosed in brackets ([ ]) can be used to match any single character in string and can include almost any character code, including digits. The entire string including the variable part occurs only one time in the column. De hecho, los caracteres especiales corchete de apertura ([ ), signo de interrogación Custom search strings in VBA IDE with wildcards? Is there any way (either or Sheet6?Sheet12 but I'm thinking that the non-alphanumeric is being treated as part of a larger text string and not a wildcard. VBA using like operator with wildcards. An exclamation point (!) at the beginning of charlist means that a match is made if any character except the characters in VBA InStrRev function can be used to easily return the filename from a string that contains the path and the filename. Or comparing any two strings in anyway really. Debugging: Verwende Debug. For example: Springer, Jerry A. VBA Excel using a wildcard and resolved object reference. Sep 13, 2016 #1 Hi everyone. The substrings will all start with a capital letter A, B, C, or D and will all have either one or two numbers. expression A variable that represents a Workbook object. Code . I went this route for you because you placed asterisks on both ends of your pattern (*sometext?_*) and assumed that this was desired. Value) - Office VBA リファレンス トピック. . Identifying Wildcard Characters (VBA) In VBA this can be done by placing these characters inside square brackets [ ]. Dim lastName As String. Formula code that will cause auto-updating, therefore, I Elseif instr(1,y,checkValue,1) Then reporter. ? (Question Mark) This represents a single character. Below are the wildcards we use in VBA LIKE operator Pattern Matching: Pattern Matching Perfection: How Instr in VBA Simplifies Complex Searches 1. Forums. Can A Wild Card Be Used With INSTR? - VB6 | Dream. The string will always be of the format [a-z][a-z][a-z]#####. The problem is the search terms include wildcards which are the following: the hyphen "-": between letters a wildcard for either a space or a しかし、まずはVBA標準の機能で、実現したいことができないかを考えることはとても大切なことです。 正規表現を使うことを考える前に、まずはLike演算子と文字列関数での処理を検討してみてください。 You may benefit from text functions in VBA to extract the part you want because your data follows a pattern: Sub test() Dim MyLeft As Long Dim MyRight As Long Dim rng As Range For Each rng In Range("A1:A3") MyLeft = InStr(1, rng. Remarks. Office VBA reference topic. ReportEvent micPass, "WebTable Checkpoint", "The webtable checkpoint object """ & checkValue & """ was found. vba; excel; Vba excel instr function with search string that ends with a unknown number. Perhaps switching to Like pattern matching would make a better boolean evaluation. Cross posted at: VBA search on cell value with wildcard If you have posted the question at more places, please provide links to those as well. Example 1 – Finding the Position from the beginning. QMT The VBA Instr String Function. VBA Wildcards. * für beliebige Zeichen und ? für ein einzelnes Zeichen). With help we got it to work with Wildcards. It's recommended that you don't mix the two types of wildcards in the same database. Now that I am search for a code were a wildcard in my case two wildcard position can be a number of Multiple characters. Introduction to Pattern Matching in VBA. And she wanted to do this for hundreds of cell at once. We will use InStrRev function with functions VBA Len and VBA Right. In. The name of my rectangle is initially "Rectangle 1". Instr function cannot detect a In this Excel VBA Select Case Like Wildcard Tutorial, you learn how to create an Excel VBA Select Case Like wildcard statement to conditionally execute a set of statements based on an expression's value, while:. Value, MyLeft) & Right(rng. Have questions or feedback about Office VBA or this documentation? I have an Access database that I am currently working on. Vba excel instr function with search string that ends with a unknown number. However, the "keywords" that I'm > looking for won't be the only thing in the cell - they will most likely > be part of a sentence. Dim SearchString, SearchChar, MyPos I am trying to search for a string in text using wildcard and returning the actual text found or the start and ending position of string in text. ; This Excel VBA Select Case Like Wildcard Tutorial is accompanied by an Excel workbook with the data True if the workbook enables wildcards for character string comparisons and searching. ” For the description of InStr: InStr function (Visual Basic for Applications) If these suggestions don't help, then share the relavant part of your code Bye . Value, "~*", vbTextCompare) > 0 then 'Additional code here End If This code can not find asterisk character. The result is 6 because the second B is the 6th character in the string. Wildcards are used to match patterns in text. Alternative of Access VBA INSTR Function – using Wildcard. value, I'm having a little trouble getting a filename using a wildcard. ” The code will determine if the substring is present and display a corresponding message in a message box. Tipps für Profis. Pattern matching in VBS. In this example, I will use the InStr function to find the position of ‘V’ in ‘Excel VBA’ from the beginning * If you type in INSTR$ with valid arguments the editor will automatically change this function to just INSTR. Hello Here's an easy one (just not easy for me!): I have a list of data where I have tag information where some have wildcard characters present in the Forums. Verwendung von vbTextCompare: Nutze diesen Parameter in der INSTR-Funktion, um die Groß-/Kleinschreibung zu ignorieren. Chr(42)). Upvote 0. Offset (, -16 The VBA Like operator is something so useful I am often surprised how rarely it is used in Excel and Access VBA. * You can use the SPLIT function to return the array containing a specified number of substrings (using wildcard searches). Case-Insensitive INSTR Test. There is a column that has lots of text in it and I am looking particularly to find any 9 digit IDs that are included in the cell and search my database with the 9 digit ID I find. For example: Dim LPosition As Integer LPosition = InStr (10, "Tech on the Net", "t") In this example, the variable called LPosition would now contain There are many ways but, I would use this approach: Function FindDepotMemo() As String Dim oldPath, tempPath, newPath As String Dim FindFirstFile As String Dim addInt as Integer ' ASSUMING YOU ALREADY HAVE THIS PATH ' WE WILL USE THIS AS BASE PATH ' AND WE WILL INCREMENT THE NUMBER AND YEAR IN IT oldPath = "G:\BUYING\Food application. For example: Dim firstName As String. Excel VBA wildcard search. Function IsInArray2(StringToBeFound As String, MyArray As Variant) As Boolean IsInArray2 = False wildCard = "*" If InStr(StringToBeFound, wildCard) > 0 Then For i = LBound(MyArray) To UBound(MyArray) VBA - Multi wildcard filter using array values. I found this Outlook VBA code, which displays found mail. Dim firName, secName As String firName = "Da*" secName = "Daniel" search = InStr(1, secName, firName, vbTextCompare) MsgBox (search) Is it possible to use asterisk * in the way I described? VBA InStr Function – Purpose, Syntax and Arguments Explanation: In this example, the substring parameter contains a wildcard (*) which means the function will search for any string that starts with an “H” and ends with “llo” within the string “Hello World”. I would love to replace a string with a "*" wildcard press ALT + F11 to enter Visual Basic. My code I know will be something similar to: Keep in mind however, the Instr output will always count from 1. The names of my two tables are: ACW,Hold. Eine Gruppe von einem oder mehreren Zeichen ( charlist), die in Klammern ([ ]) eingeschlossen sind, kann verwendet werden, um jedes einzelne Zeichen im Ausdruck abzugleichen, und kann fast alle Zeichen im ANSI-Zeichensatz enthalten, einschließlich Ziffern. Wildcard vlookup in arrays - VBA. Value, " (") - 1 MyRight = InStr(1, rng. So i want to replace the numbers with wildcard (i assume this is best way) but it doesnt work properly. I believe I'm going to need something like an array. From your example, you have the asterisk at the end, so I'm assuming you care how an item starts, not that a sub-string exists anywhere. Value, Len(rng. If Instr(SearchString, target) then ' Do stuff End If Alternatively, you can use "Like": If SearchString LIKE "*" &target & "*" Then 'Do stuff End If Share VBA wildcard statement. What I want to do: 1) search if string contains number in format 3123456/001 where numbers after "3" are random, and 8th character is "/" - in wildcard this looks like that 3#####/0## (already done and working) 2) if string contains desired number to remove from string anything but this number VBA wildcard statement. I want to type COMPANY1-SHORT: Left([COMPANY1],(InStr([COMPANY1],"#")-2)) so I get everything to the left of the # sign in the company name field. Interior. The InStr function doesn't use pattern matching so your wildcard asterisk is being treated as a literal asterisk character (e. This structure passes a string through to a "Find" or "Replace" command that searches the sheet. Count, If InStr(1, WS. B. Ever The Dictionary Items method returns an array of all the items. 50. InStr is a very powerful and useful function when having to locate substrings withing another text string. If you just want to check if a text contains specific substring, you can use wildcard to return TRUE or FALSE. * You can use the JOIN function to return a text string containing all the elements in an array. Perhaps you can use the Like operator. Select Range(Selection, Selection. The VBA Instr Function returns the starting position of a substring within another string. 4. With the Left function you can output the text prior to a string of text: Sub Instr_Left Dim str As String Dim n As Long str = "Look Here" n = InStr (str, "Here") MsgBox Left (str, n -1) End Sub Using Instr in Microsoft Access VBA Learn more about: Like Operator (Visual Basic) Character Lists. Enter the below vba code in a new As String If strText Like "W*stenrot*" Then Dim intpos As Integer intpos = InStr(strText Hello, I am using the VBA replace function and wondering if I can include wildcard to find a text. Example. Since there is no inbuilt functionality in Excel that can do that, I created a simple macro that uses the Excel VBA InStr function (you will see Im trying to look up a string which contains wildcards. Wildcard Matching Pattern * Zero or More Characters? Any Single Character # Any Digit (0-9) [charlist] Any character in charlist [!charlist] There is a valid way to use a wildcard in vba. , however a line VB. So let’s get right to it! IMPORTANT To keep in mind! This will match blahtestingsometext1_whateverblah as well, because there are no start/end of string anchors. This function is case-sensitive. Remember that VBA indexes strings starting at index 1: Rather than wildcard: Sub color() Dim myRange As Range, valuee As String valuee = InputBox("Search String:") If valuee = vbNullString Then Exit Sub Range("A1"). Returns 0 if substring not found. The InStrB function is used with byte data contained in a string. I have 2 tables and I want to combine both tables. I often tend to see the Like operator as the last resort before using Regular Expressions in VBA. Wildcards can be used with the Like operator and with various functions and methods that support wildcards. ANSI-92 is used when you want your syntax to be compliant with a Microsoft SQL Server™ database. End(xlToRight)). Also, I do not want to simply place the formula I am using into cells with a Range("D2"). Improve this answer. Like operator * You can use the INSTR function to return the position of a substring within a larger string, starting at the beginning. search ,find和search都是工作表函数,要在VBA中用前面必须加application,其可以用来在工作表中查找单元格,这个功能我们在Find用法一节已经介绍过,也可以在字符串中查找某个字符,用法和instr差不多,find和search的差别与在工作表中是相同的,find区分大小写,search不区分大小写。 She wanted to know how to apply bold font format to a specific part of a string within a cell. There may be more than one substring in a string, so I need to loop through the string to find all There's also an issue with using InStr that if you're looking for "Mr" and the name is "Mr Imram Dave" it will find "Mr" in two places since it uses vbTextCompare which ignores case. Since the INSTR function does not use wildcards, can the VBA LIKE or any similar function return I suppose the problem is that VBA thinks that i want to find exactly * as normal character instead of anything. Se puede usar un grupo de uno o más caracteres ( charlist) entre corchetes ([ ]) para coincidir con cualquier carácter único de la expresión y puede incluir casi todos los caracteres del conjunto de caracteres ANSI, incluidos los dígitos. InStr function in VBA Excel is returning 0 Even If Specified Spring Occurs in A String. Print, I have a spreadsheet I receive regularly with a large number of cells containing names. 角かっこ ([ ]) で囲まれた 1 つ以上の文字 ( charlist) のグループは 、式 内の任意の 1 文字と一致させるために使用でき、 ANSI 文字セットには数字を含むほぼすべての文字を含めることができます。 実際、特殊文字の開始角かっこ ([ )、疑問符 (?)、数字記号 Re: [RESOLVED] VB Numeric / digit Wildcard with Instr Originally Posted by leinad31 With Split, all the strings are allocated into memory (several malloc/dealloc), when your only trying to get the first match (all other matches irrelevant and will only slow down processing). xls - its done this way just so that I can add new Good_Text and Bad_Text to the list more easily. VBA supports the i am testing against (100 - 200 of 1000) but it changes frequently. My VBA collects number figures like $80,000. Note that the syntax for the InstrRev function is not the same as the syntax for the Instr function. I want to be able to find a string within another where I do not know the exact form and to use wildcards. vba excel - find string wildcard. It replaces greatly the VBA InStr function when needing to check if a certain substring is present within a certain string. Value, ")") Debug. VBA Len function returns the length of a string: MsgBox Len("XBCX") 'Result is: 4. The VBA InStr function finds the position of a substring matched within a certain string. If Statement Excel Wildcard. A wildcard can be Hello guys, I'm trying to find out if theres any way to use a wildcard in the instr function. I want the code to run in Excel with wildcard search options and open an Excel file. So Office VBA-Referenzthema. See also. Instr(1,"MyString",^t) I tried it in vain, but maybe, there is a way around Thanks, Hi, how do i use the match function in VBA in order to match 2 conditions (range is column A1:A500): 1st condition: beginning of cell needs to start with "1_" 2nd condition: cell needs to contain "wide grip" (this is usually the last 2 words of VBA InStr() Not working the way I thought it would. Define the pattern you want to match, incorporating wildcard excel characters such as “?” If the InStr function can not find the substring within the main string, it would return 0. Built-in pattern matching provides a versatile tool for making string comparisons. Because some of the searched criterion aren't exactly alike, I am trying to use a "*" wildcard operator around cell C2 to search for like items. Wildcards in VBA. VBA supports the below three Wildcard characters. Joined Sep 13, 2016 Messages 2. Instr will look for the instances of the string you have in the second part of the statement. and I'm trying to get VBA to remove the last period to make it look like $80,000. UseWildcards. I'm looking for a way to clean string in VBA. Wildcard search for the wildcard characters * and ? All cells and their entire contents with the selected option FoundList As String For Each cell In ActiveSheet. com You might try using the Like operator instead. Wildcard in Strings: Wenn du Wildcards in VBA-Strings verwendest, achte darauf, dass du die richtigen Zeichen für die Wildcards nutzt (z. Variables are used to hold the values you want to compare. Otherwise, it returns the character position where the text is found. I want to use the instring function, but the character in my field that I need to search for happens to be a wildcard. It returns 0 if the text is not found. Um nach den Sonderzeichen linke eckige Klammer ([ ), Fragezeichen Ich habe mich auch schon in anderen VB(A)-Foren nach Lösungen umgesehen (habe aber kein cross posting durchgeführt) bin dort aber auch nicht auf ähnliche Fragestellungen / Lösungsansätze getroffen. 1. The Instr Function performs exact Alternative of Excel VBA INSTR Function – using Wildcard. We can check whether the string contains a substring in VBA or whether the string contains any specific format. Instr Function Not Finding Substring. Replace What:=Bad_Text, Replacement:=Good_Text, LookAt:= _ xlPart, searchorder:=xlByRows, MatchCase:=True, SearchFormat:=False, _ I'm trying to find a sting like "AFE43542" within a web page html with instr. I would like to know if wildcards in simple VBA replace function work. Some cells have a full name including a middle initial with a period. Wildcard: Greetings, I am able to insert text in one cells based on the value of another cell. InStr Example. In the new sheet it is changed to "Rectangle 2". Value, "Worthington") > 0 And InStr(c. VBA Right function returns n characters from the end of a string: Example in VBA Code. The issue I am coming across is that the field I am using to match both tables is not always the same, meaning I will have to use a wildcard and I am not too sure on how to do that. 0. The following code shows you how you would use the Like Operator and the ? wildcard to match a pattern in your code:. ColorIndex = 22 cell. I'm using a wildcard because the filename has a "version" in it so in this case "Test v*" could be "Test v1" or "Test v2" because of this I want it to pull the name of whatever version is currently on the desktop. VBA InStr. I need to find where in a specific row the string occurs. Auch eine Alertnativ-Lösung für SearchB konnte ich nicht finden, geschweige denn eine Erklärung für SearchB in der VBA-Hilfe. Searching for a file with different keywords. Each selection upon this membership Instr can be used along with other text functions like Left, Right, Len, and Mid to trim text. Print Left(rng. New posts I know that VBA is flakey when searching for strings If InStr(3, cell, "#") Then cell. Syntax. If the pattern matches the string, then the VBA LIKE operator returns TRUE or else FALSE. Net String comparison and Wildcard values. Welche Excel-Version benötige ich, um VBA mit Wildcards zu verwenden? VBA mit Wildcards ist in den meisten modernen Excel-Versionen verfügbar, einschließlich Excel 2010, 2013, 2016, 2019 und Microsoft 365. net regex comparison to string. Step 3: The output is 0, as shown in the following image. Cells. I have a difficult situation and so far no luck in finding a solution. Have questions or feedback about Office VBA or this documentation? Worksheet Description VBA ; CHAR: Returns the character specified by the code number: CHR: CLEAN: Removes all nonprintable characters from text Characters 0-31, 129, 141, 143, 144, and 157 Is it possible to use a wilcard character, for example the VBA for WORD wildcard ^t to search for a tab. Excel VBA - Sheet Name Wild Card Search. This example uses the InStr function to return the position of the first occurrence of one string within another. Value, Excel VBA wildcard search. UsedRange 'search cell for an * If InStr(cell, "*") Then FoundList = FoundList & "Cell Step 3: If your code requires variables, use the Dim statement to declare them. In this case I have a JSON object of the form: json_object = "{'id':'id1', 'name':'name1 The like statement is the wildcard in VBA Excel. Sub Exception() Dim mfc As Worksheet Dim mfp As Worksheet Dim mfo As Worksheet Dim instr As Worksheet Set mfc = Sheets("FC") Set mfp = Sheets("FP") Set mfo = Sheets("OSLR") Set inst = Sheets("Instr") Dim irng As Range Dim icel As Range Set irng = inst. This capability is particularly useful when dealing with large datasets or when performing complex data validation tasks. The string all take form of "IP##W## XX" where XX are the 2 letters by which I look up the value and the ## are the number wildcards that can be vba wildcard F. Support and feedback. Now let’s have a look at some example of using the Excel VBA InStr Function. Hello guys, I'm trying to find out if theres any way to use a wildcard in the instr function. Select For Each myRange In Selection If InStr(myRange. Can word wildcards or regular expressions be used inside InStr function in Excel VBA? The wildcard characters conform to the Microsoft Visual Basic® for Applications (VBA) specification, not SQL. vb. learn. Excel VBAで、「Select Case」を使う方法について解説していきます。「Select Case」を使えば、範囲や、Likeとワイルドカード、複数条件での条件分岐をすることができます。「Select Case」をうまく使えば、条件分 Try using Instr: If InStr(Cells(1, 1), MyStr) > 0 Then MsgBox "Found it" "oodam" wrote: > > I'm trying to use a formula that will check the contents of a cell and > color the cell's row accordingly. Working with the Like operator; and; Considering wildcards. End(xlDown)). While matching strings, we need to use wildcard characters to the pattern we specify. For example my string is "a) Akli Amine Mohamed b) Killech Shamir c) Kali Sami Elias" and i want to replace the letter and closing brackets with a semi colon so Wildcard Characters * (Asterisk) This represents multiple characters. For example We?k will identify Week and Weak. * You can use the MID Function to return a substring from the middle, left or right of a string. Here we set the start position to 3 to skip the first B: Sub Instr_StartPosition() MsgBox InStr(3, "ABC ABC", "B") End Sub. I've used Home. New posts Search forums. Excel VBA: Make InStr find whole string, Remarks. Let assume a simple text string “Hello There!”. Range("A130:A190") Dim LastRowC As Long LastRowC = mfc. and when parsing I want to look for all lines that match * told * to go to startCharacter - a number (Long) searchInText - string (no RegEx, or pattern matching, or wildcard characters) searchForText - string (no RegEx, or pattern matching, or wildcard characters) compareMode - a number (from -1 to 2) It returns a number (Variant - Long) - the index where searchForText is found within searchInText The wildcard character is the Asterisks (*) and you can place it before, inbetween, For Each c In rng If InStr(c. Note that Wildcard is case sensitive. How can I find exact Instr value. 3. By default, VBA treats “L” different from “l”. 07 EUR". Read-only Boolean. Step 2: Press F5 or run the VBA code manually, as shown in the following image. pattern matching in vba is a powerful technique that allows developers to search for specific patterns within strings. For example Ex* will identify Excel, Example, Expert etc. The var part of the string is as you might guess highly variable where the other three parts of the string are fixed. find 和 application. VBA Find value in row using wildcard. But with what I've Tema de referencia de VBA de Office. The InStr function can be used in VBA code in Microsoft Access. BOOL. Cells(Rows. F. Step 4: Within your VBA code, use the VBA Like operator to compare strings. The following table shows the wildcard characters you can use with the Like operator and the Is it possible to use a wildcard with the Instr() function? For example, if I want to determine if a string contains a string that has any alphabetic character followed by a hyphen, You can use the Like operator in VBA along with the following built-in wildcard characters to search for specific patterns in strings: *: Matches any number of characters?: Matches a single character #: Matches a single The VBA Instr Function checks if a string of text is found in another string of text. g. Cells(intRow, 6). expression. This is the core of the VBA function, where Bad_Text and Good_Text are variables that iterate through a list of them in my Personal. microsoft. What is wrong with this wildcard then? excel; vba; If InStr(1, shp. Wildcards are used in all programming languages and database application like SQL Server. If InStr(1, Contents(i), SubStrings(j), vbTextCompare) = 0 Home » Excel Vba Instr Wildcard Excel Vba Instr Wildcard Excel VBA InStr Function Explained With ExamplesExcel VBA InStr Function Explained With Examples - The main switchboard of this Excel Vba Instr Wildcard presents numerous general options which are enter/view members, enter/view other information, preview reports, and exit. Say for instance I wanted to parse a log file that would have a line in it like (this is totally made up out of my head btw hehe) Susan told Mike to go to the Zoo. So i have a string variable, let's say: str = " Lorem Ipsum 3. ” Hence, the function returns 0 because it could not find the uppercase letter “A” in the word “Bangalore. * You can use the INSTRB function that is used with byte data. Although in this code, it would only return 1 since it only checks each item in anyOf once, and InStr returns the first position found, not a count of occurrences. 50 but without using VBA coding question I have a good amount of experience with VBA coding, but I ran into an issue that I have not found a way around yet. I am using an Index(Match()) function in my vba code that seems to be experiencing some issues. InstrRev will not find an instance of stringmatch unless the position of the end character of stringmatch is less than or equal to start. This tutorial will demonstrate how to use wildcards in VBA. I tried to search the subject with wildcard "*", like "Task Completed*" and "Task Completed on & Format(Date, "dd/mm/yyyy")" for which I got an syntax error/compile error I can guess at what you are trying to do, but perhaps you can iterate it for us all. Excel VBA - Looking up a string with wildcards. Instead of returning the character position of the first occurrence of one string within another, InStrB returns the byte position. In Access VBA, if you just want to check if a text contains specific substring, you can use wildcard to return TRUE or FALSE. 一组包含一个或多个字符 ( 字符列表) 括在方括号 ([ ]) 可用于匹配 表达式 中的任何单个字符,并且可以包括 ANSI 字符集中的几乎所有字符,包括数字。 事实上,只有用括号括起来时,特殊字符(如左方括号 ([])、问号 (?)、数字符号 (#) 和星号 (*) )才能用来直接与自身匹配。 Hi again, sorry guys cant seam to find something that works in my case. 6. Felix222 New Member. Since the argument “vbBinaryCompare” is supplied, the VBA InStr function in excel searches for the uppercase letter “A. 2. Office VBA 参考主题. You can Join those into a big string then use Instr() to determine if your search string is in the big string. 07 EUR Dorum" I am required to remove this part "3. mgdauh lnv npms vvhic agdliij dbzgrd xufikx eczc jmov rtg vnfpq hkhmv xmolgn umydz ktjv