![]() |
Why doesn't INSTREV work for me?
I'm using INSTREV to retrieve the location of a character in a string by
searching from the end of the string. When I type the following in the immediate window: ?InStrRev("1234567-89", "-") I get an answer of 8. I was expecting 3. (The position of the "-" is 3 characters from the right-hand side of the string) Am I interpreting this incorrectly? |
Why doesn't INSTREV work for me?
On Thu, 21 Feb 2008 06:20:03 -0800, dsimcox
wrote: I'm using INSTREV to retrieve the location of a character in a string by searching from the end of the string. When I type the following in the immediate window: ?InStrRev("1234567-89", "-") I get an answer of 8. I was expecting 3. (The position of the "-" is 3 characters from the right-hand side of the string) Am I interpreting this incorrectly? Yes. Although it starts looking from the end of the string, it still gives the position numbered from the beginning of the string. ?InStrRev("12-34567-89", "-") would give an answer of 9. --ron |
Why doesn't INSTREV work for me?
That is the way the InStrRev function works... it simply performs its search
for your specified character from the right to left, but it tells you which character position in the text, counting from the left, the search character is located at... it is **not** a Right function replacement of any kind. I'm guessing from your question that you are trying to isolate the characters after the last dash. Just use the Mid function omitting the optional 3rd argument... Text = "1234567-89" LastDashLocation = InStrRev(Text, "-") ? Mid$(Text, LastDashLocation + 1) or, in one step... ? Mid$("1234567-89", InStrRev(Text, "-") + 1) Rick "dsimcox" wrote in message ... I'm using INSTREV to retrieve the location of a character in a string by searching from the end of the string. When I type the following in the immediate window: ?InStrRev("1234567-89", "-") I get an answer of 8. I was expecting 3. (The position of the "-" is 3 characters from the right-hand side of the string) Am I interpreting this incorrectly? |
Why doesn't INSTREV work for me?
Hi,
It is working for you, it returns the position of the last occurence of the search character not the position from the right hand side Try this myposition = Len("1234567-89") - (InStrRev("1234567-89", "-", -1, vbBinaryCompare) - 1) Mike "dsimcox" wrote: I'm using INSTREV to retrieve the location of a character in a string by searching from the end of the string. When I type the following in the immediate window: ?InStrRev("1234567-89", "-") I get an answer of 8. I was expecting 3. (The position of the "-" is 3 characters from the right-hand side of the string) Am I interpreting this incorrectly? |
Why doesn't INSTREV work for me?
Thank you, Rick and Mike.
That possiblity never occurred to me. I understand how it works now - but I think I would have designed it to work the other way! Appreciate you help this morning. "Mike H" wrote: Hi, It is working for you, it returns the position of the last occurence of the search character not the position from the right hand side Try this myposition = Len("1234567-89") - (InStrRev("1234567-89", "-", -1, vbBinaryCompare) - 1) Mike "dsimcox" wrote: I'm using INSTREV to retrieve the location of a character in a string by searching from the end of the string. When I type the following in the immediate window: ?InStrRev("1234567-89", "-") I get an answer of 8. I was expecting 3. (The position of the "-" is 3 characters from the right-hand side of the string) Am I interpreting this incorrectly? |
Why doesn't INSTREV work for me?
Morning? it may be for you!! Thanks for the feedback.
"dsimcox" wrote: Thank you, Rick and Mike. That possiblity never occurred to me. I understand how it works now - but I think I would have designed it to work the other way! Appreciate you help this morning. "Mike H" wrote: Hi, It is working for you, it returns the position of the last occurence of the search character not the position from the right hand side Try this myposition = Len("1234567-89") - (InStrRev("1234567-89", "-", -1, vbBinaryCompare) - 1) Mike "dsimcox" wrote: I'm using INSTREV to retrieve the location of a character in a string by searching from the end of the string. When I type the following in the immediate window: ?InStrRev("1234567-89", "-") I get an answer of 8. I was expecting 3. (The position of the "-" is 3 characters from the right-hand side of the string) Am I interpreting this incorrectly? |
Why doesn't INSTREV work for me?
Thank you, Rick and Mike.
Do you have something against Ron?<g (He also answered you.) That possiblity never occurred to me. I understand how it works now - but I think I would have designed it to work the other way! That would make working with it rather difficult I would think, especially in situations where both the InStr and InStrRev functions were used in the same expression. My guess is that you are thinking that because of the immediate use you need to put it to and are not looking at the "bigger picture" of the situations where it can be used at. Rick |
Why doesn't INSTREV work for me?
Rick,
Do you have something against Ron?<g (He also answered you.) Clearly we have a posting problem because the only answers I see are from you and I, nothing from Ron? Mike "Rick Rothstein (MVP - VB)" wrote: Thank you, Rick and Mike. Do you have something against Ron?<g (He also answered you.) That possiblity never occurred to me. I understand how it works now - but I think I would have designed it to work the other way! That would make working with it rather difficult I would think, especially in situations where both the InStr and InStrRev functions were used in the same expression. My guess is that you are thinking that because of the immediate use you need to put it to and are not looking at the "bigger picture" of the situations where it can be used at. Rick |
Why doesn't INSTREV work for me?
Do you have something against Ron?<g (He also answered you.)
Clearly we have a posting problem because the only answers I see are from you and I, nothing from Ron? My newsreader shows Ron Rosenfeld as the first responder to this thread (his message was posted approximately 4 minutes before mine was). Rick |
Why doesn't INSTREV work for me?
Nope,
In order OP You Me.Same time as yourself OP +18 Minutes Me You Me You and in a few minures this one. Mike Mike "Rick Rothstein (MVP - VB)" wrote: Do you have something against Ron?<g (He also answered you.) Clearly we have a posting problem because the only answers I see are from you and I, nothing from Ron? My newsreader shows Ron Rosenfeld as the first responder to this thread (his message was posted approximately 4 minutes before mine was). Rick |
Why doesn't INSTREV work for me?
I should add I'm here
http://www.microsoft.com/office/comm...ang=e n&cr=US Mike "Rick Rothstein (MVP - VB)" wrote: Do you have something against Ron?<g (He also answered you.) Clearly we have a posting problem because the only answers I see are from you and I, nothing from Ron? My newsreader shows Ron Rosenfeld as the first responder to this thread (his message was posted approximately 4 minutes before mine was). Rick |
Why doesn't INSTREV work for me?
Nope,
In order OP You Me.Same time as yourself I show your post as coming in 4 minutes after mine. OP +18 Minutes However, I do see the 18 gap for the OP though. Me You Me You and in a few minures this one. With the exception of Ron's posts, I see the same message tree as you do. Strange. By the way, I see from your parallel post in this sub-thread that you are using a web newsreader... I am using Window (Vista) Mail via a direct account set up with the microsoft.public.excel.misc news server. Rick |
Why doesn't INSTREV work for me?
Ron, if you haven't already done so, you should read the sub-thread started
by Mike H... it seems that you posting is not visible in Microsoft's online newsreader.... http://www.microsoft.com/office/comm...ang=e n&cr=US I'm not sure why, or if this is an ongoing problem with your postings or not, but you might want to try and discover why. Rick "Ron Rosenfeld" wrote in message ... On Thu, 21 Feb 2008 06:20:03 -0800, dsimcox wrote: I'm using INSTREV to retrieve the location of a character in a string by searching from the end of the string. When I type the following in the immediate window: ?InStrRev("1234567-89", "-") I get an answer of 8. I was expecting 3. (The position of the "-" is 3 characters from the right-hand side of the string) Am I interpreting this incorrectly? Yes. Although it starts looking from the end of the string, it still gives the position numbered from the beginning of the string. ?InStrRev("12-34567-89", "-") would give an answer of 9. --ron |
Why doesn't INSTREV work for me?
On Thu, 21 Feb 2008 11:32:46 -0500, "Rick Rothstein \(MVP - VB\)"
wrote: Ron, if you haven't already done so, you should read the sub-thread started by Mike H... it seems that you posting is not visible in Microsoft's online newsreader.... http://www.microsoft.com/office/comm...ang=e n&cr=US I'm not sure why, or if this is an ongoing problem with your postings or not, but you might want to try and discover why. Rick Thanks for the tip, Rick. This is not the first time that I have felt ignored. I will check out that link. --ron |
Why doesn't INSTREV work for me?
who said that? <g
"Ron Rosenfeld" wrote: On Thu, 21 Feb 2008 11:32:46 -0500, "Rick Rothstein \(MVP - VB\)" wrote: Ron, if you haven't already done so, you should read the sub-thread started by Mike H... it seems that you posting is not visible in Microsoft's online newsreader.... http://www.microsoft.com/office/comm...ang=e n&cr=US I'm not sure why, or if this is an ongoing problem with your postings or not, but you might want to try and discover why. Rick Thanks for the tip, Rick. This is not the first time that I have felt ignored. I will check out that link. --ron |
Why doesn't INSTREV work for me?
On Thu, 21 Feb 2008 11:32:46 -0500, "Rick Rothstein \(MVP - VB\)"
wrote: Ron, if you haven't already done so, you should read the sub-thread started by Mike H... it seems that you posting is not visible in Microsoft's online newsreader.... http://www.microsoft.com/office/comm...ang=e n&cr=US I'm not sure why, or if this is an ongoing problem with your postings or not, but you might want to try and discover why. Rick Nothing is apparent, although obviously you were able to see my post using your newsreader and not going through the web version. I have sent a tech support email to Forte (I use Agent as my newsreader) and I'll see what they say. Whatever it is, it seems to be only an intermittent problem. I notice that although my first response to the OP did not show up, others of my responses did. In addition, your post to me shows up on the MS newsgroup as a blank post from an unknown person! --ron |
Why doesn't INSTREV work for me?
I just looked back on the link you posted earlier... Ron is still not in the
original thread, but his latest post shows up in the new thread... strange. By the way, this is the first time I have really looked a web newsreader... what a horrible interface it provides... the same thread is broken up into two (so far) separate threads even though the subject is the same and the newer thread is really just a continuation of the older one. How does anyone follow a continuous thread of posts if the (web) newsreader is breaking them into separate threads with on apparent (at least to me) rhyme or reason? Rick "Mike H" wrote in message ... who said that? <g "Ron Rosenfeld" wrote: On Thu, 21 Feb 2008 11:32:46 -0500, "Rick Rothstein \(MVP - VB\)" wrote: Ron, if you haven't already done so, you should read the sub-thread started by Mike H... it seems that you posting is not visible in Microsoft's online newsreader.... http://www.microsoft.com/office/comm...ang=e n&cr=US I'm not sure why, or if this is an ongoing problem with your postings or not, but you might want to try and discover why. Rick Thanks for the tip, Rick. This is not the first time that I have felt ignored. I will check out that link. --ron |
Why doesn't INSTREV work for me?
Curiouser & Curiouser the starter of this thread - presunably Rick - is
showing up as 'Unknown' to me. Clearly we have a gremlin of; as yet, indeterminate origin Mike "Ron Rosenfeld" wrote: On Thu, 21 Feb 2008 11:32:46 -0500, "Rick Rothstein \(MVP - VB\)" wrote: Ron, if you haven't already done so, you should read the sub-thread started by Mike H... it seems that you posting is not visible in Microsoft's online newsreader.... http://www.microsoft.com/office/comm...ang=e n&cr=US I'm not sure why, or if this is an ongoing problem with your postings or not, but you might want to try and discover why. Rick Nothing is apparent, although obviously you were able to see my post using your newsreader and not going through the web version. I have sent a tech support email to Forte (I use Agent as my newsreader) and I'll see what they say. Whatever it is, it seems to be only an intermittent problem. I notice that although my first response to the OP did not show up, others of my responses did. In addition, your post to me shows up on the MS newsgroup as a blank post from an unknown person! --ron |
Why doesn't INSTREV work for me?
Ron, if you haven't already done so, you should read the sub-thread
started by Mike H... it seems that you posting is not visible in Microsoft's online newsreader.... http://www.microsoft.com/office/comm...ang=e n&cr=US I'm not sure why, or if this is an ongoing problem with your postings or not, but you might want to try and discover why. Nothing is apparent, although obviously you were able to see my post using your newsreader and not going through the web version. I have sent a tech support email to Forte (I use Agent as my newsreader) and I'll see what they say. Whatever it is, it seems to be only an intermittent problem. I notice that although my first response to the OP did not show up, others of my responses did. In addition, your post to me shows up on the MS newsgroup as a blank post from an unknown person! Yes, I just saw that and I posted a message back to Mike commenting what a horrible interface the web newsreader provides. Not only is the new thread shown as started by an unknown person (what is with that?), the thread is totally separated from the original thread of which it is a part... my question was, how does anyone follow a threaded set of postings if the (web) newsreader is breaking them apart with no apparent rhyme or reason? Rick |
Why doesn't INSTREV work for me?
On Thu, 21 Feb 2008 12:55:55 -0500, "Rick Rothstein \(MVP - VB\)"
wrote: Yes, I just saw that and I posted a message back to Mike commenting what a horrible interface the web newsreader provides. Not only is the new thread shown as started by an unknown person (what is with that?), the thread is totally separated from the original thread of which it is a part... my question was, how does anyone follow a threaded set of postings if the (web) newsreader is breaking them apart with no apparent rhyme or reason? Rick Poorly? --ron |
Why doesn't INSTREV work for me?
The "starter of the thread" was actually Ron... my message was a response to
his posting (the one I can see, but that you can't see)... since the web newsreader didn't/can't see his message, I guess it isn't sure who I was answering, but why call **me** the "unknown person"... it should know who I am as it can see my entire posting. Rick "Mike H" wrote in message ... Curiouser & Curiouser the starter of this thread - presunably Rick - is showing up as 'Unknown' to me. Clearly we have a gremlin of; as yet, indeterminate origin Mike "Ron Rosenfeld" wrote: On Thu, 21 Feb 2008 11:32:46 -0500, "Rick Rothstein \(MVP - VB\)" wrote: Ron, if you haven't already done so, you should read the sub-thread started by Mike H... it seems that you posting is not visible in Microsoft's online newsreader.... http://www.microsoft.com/office/comm...ang=e n&cr=US I'm not sure why, or if this is an ongoing problem with your postings or not, but you might want to try and discover why. Rick Nothing is apparent, although obviously you were able to see my post using your newsreader and not going through the web version. I have sent a tech support email to Forte (I use Agent as my newsreader) and I'll see what they say. Whatever it is, it seems to be only an intermittent problem. I notice that although my first response to the OP did not show up, others of my responses did. In addition, your post to me shows up on the MS newsgroup as a blank post from an unknown person! --ron |
Why doesn't INSTREV work for me?
"Rick Rothstein (MVP - VB)" wrote in message ... Ron, if you haven't already done so, you should read the sub-thread started by Mike H... it seems that you posting is not visible in Microsoft's online newsreader.... http://www.microsoft.com/office/comm...ang=e n&cr=US I'm not sure why, or if this is an ongoing problem with your postings or not, but you might want to try and discover why. Nothing is apparent, although obviously you were able to see my post using your newsreader and not going through the web version. I have sent a tech support email to Forte (I use Agent as my newsreader) and I'll see what they say. Whatever it is, it seems to be only an intermittent problem. I notice that although my first response to the OP did not show up, others of my responses did. In addition, your post to me shows up on the MS newsgroup as a blank post from an unknown person! Yes, I just saw that and I posted a message back to Mike commenting what a horrible interface the web newsreader provides. Not only is the new thread shown as started by an unknown person (what is with that?), the thread is totally separated from the original thread of which it is a part... my question was, how does anyone follow a threaded set of postings if the (web) newsreader is breaking them apart with no apparent rhyme or reason? Rick It's a terrible interface, and each revision makes it worse. - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ |
All times are GMT +1. The time now is 08:56 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com