instr function

  1. T

    VBA conditional searching for entire cell contents

    I am trying to write a VBA module to help me identify the source of an excel file that I am given based on known cell values in the header. For example if ""Service Waiver Acknowledged"" exists in any position of the range A1:Z5 then I know this file came from Software1 whereas if ""AnnivDay""...
  2. R

    Search string containing two specific text

    Evening gurus, I'm trying to run a formula on a adjacent cell column if the source cell contains two specific text which are defined. Formula 1 is to straight forward and will not be using InSTR function, however for Formula 2, the two specific text are "MODRETSUBUNIT" and "OPONEMS". A sample...
  3. N

    VBA InStr() Function Nested Or/And Issue

    I can't seem to get the syntax right on my nested OR/ANDs section so I keep getting an error - please help! I'm sure there is a better way to do this than having all the InStr() OR InStr() but I'm not comfortable in VBA at all so I dont' know very much <code style="margin: 0px; padding: 0px...
  4. A

    VBA Newbie - Runtime Error 91 using InStr

    Hi all. I've gotten a lot of use out of MrExcel in the past, and I'm banging my head against a wall here. Complete VBA newbie (my last years of programming was 20+ years ago). I'm getting the error "Object variable or With block variable not set" at the highlighted line. Option Explicit...
  5. bobkap

    InStr function

    I am trying to see if a string contains a certain word or just letters like "ABC". This line of code I have works but ONLY if the word I'm looking for is at the very beginning of the string. If the word is say starting at the 5th character of the string I get a zero for the result. How should...
  6. E

    instr issue with matching string in another string

    Hi guys, Instr doesnt seem to be matching properly for me, and I dont know what Im doing wrong. I get a match if my criteria value is the same as my search location value, but if the string is in the other string without matching it exactly, my code doesnt pick up on it...
  7. H

    If Statement Not Firing Properly

    Hi all, I am trying to correct an error on many spreadsheets (100+) we have located out on a network drive. I had a formula that was incorrectly written and needs to be updated. I've written the code below to be used in a loop macro that opens up each spreadsheet and updates the formulas (if...
  8. J

    Macro using InStr not returning expected results.

    I have macro that is to reference a list of word on a worksheet ("List")and then check for the list in a another worksheet ("sheet 1"). If a word is present in the list then certain formatting will be done to columns A:E of the sheet 1 worksheet. The macro partially works, except it fills the...
  9. M

    InStr only finds first occurrence of a match... how to i find them all?

    Hello, I am using inkEdit to change the color of all strings in my inkEdit textbox " SAVED " to be green. Only problem is that it will only make the first occurrence green and not any of the others. How do i fix this? thanks! Private Sub inkChange() Dim iStart iStart =...
  10. L

    VBA Delete part of value if it contains VIN#

    Hi All I have cobbled together the code below to try and clean up some data. The code seems to identify the correct values but returns very strange and inconsistent results. What I am trying to do, is look down Col W and any cell that contains "VIN#" delete the "VIN#" and 9 characters to the...
  11. J

    For loop to find values on a webpage from label array returning 0

    Hi All, I'm hoping you could help me with an issue I've been having while trying to search for values from a label array on a webpage. What I'm trying to do is find a value from a label on a userform on a webpage and then have it display the results back on the userform. The loop seems to work...
  12. A

    VBA instr function help

    Hi, I am new to VBA. My task is to copy all relevant worksheets into a new workbook. The name of the worksheets are stored in a worksheet called "Team list". I don't know whats wrong with my code. Can someone save me please?? If Err.Number = 0 Then For Each Worksheet In Worksheets If InStr(1...
  13. C

    VBA: Regular Expressions

    I need help creating a function to compare strings; probably using regular expressions since it is a bit tricky. We have six strings: String 1: "V06+K73+U55+M67" String 2: "!M43" String 3: "!U67" String 4: "V06" String 5: "" String 6: "" In this case, "!" means 'not' so this statement would...

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top