+ Reply to Thread
Results 1 to 7 of 7

Need help returning exact call value using InStr function

  1. #1
    Registered User
    Join Date
    11-23-2020
    Location
    Portland, Oregon
    MS-Off Ver
    365
    Posts
    3

    Need help returning exact call value using InStr function

    Hi! I am stuck!

    The code below is looping through a series of cells looking for the first occurrence of "CRNA" in column H. I can get it to return a string if the value is found but I cannot get it to return the exact cell value. So for example if it states CRNA then I want it to place the entire contents of cell H in R.

    Any ideas? I have bolded where I am stuck in the code.


    Please Login or Register  to view this content.
    Last edited by oelmagba; 11-23-2020 at 02:24 PM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,416

    Re: Need help returning exact call value using InStr function

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. As you are new, I have done it for you today.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Need help returning exact call value using InStr function

    So you want return the value in column R from the row where you find a cell containing 'CRNA' in column H?
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    11-23-2020
    Location
    Portland, Oregon
    MS-Off Ver
    365
    Posts
    3

    Re: Need help returning exact call value using InStr function

    Thank you, Ali! That was helpful and I will ensure to include it in future postings. I am so excited to be a part of this community!

  5. #5
    Registered User
    Join Date
    11-23-2020
    Location
    Portland, Oregon
    MS-Off Ver
    365
    Posts
    3

    Re: Need help returning exact call value using InStr function

    Yes! That is correct. It seems like such a simple concept that I am unable to grasp. In reality it may not be as simple as I think it is (Novice here). Thank you for your help!

  6. #6
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Need help returning exact call value using InStr function

    Give this code a try

    Please Login or Register  to view this content.

  7. #7
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: Need help returning exact call value using InStr function

    I would filter on Col H for "CRNA" and then update col R at once...
    Can only say if you upload a sample file...
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Instr Not Returning True??
    By schulzy175 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-08-2017, 06:06 PM
  2. Replies: 6
    Last Post: 11-27-2016, 09:53 AM
  3. [SOLVED] Instr to look for a complete, exact match of a string
    By SandPounder1 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 04-30-2014, 03:50 PM
  4. [SOLVED] VBA code not returning correct string using MID and InStr
    By kramtelbuab in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-04-2013, 11:30 PM
  5. Instr() function
    By Lifeseeker in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-20-2011, 03:57 PM
  6. [SOLVED] InStr Function
    By zoot in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-04-2006, 10:55 PM
  7. Replies: 0
    Last Post: 08-25-2005, 03:46 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1