LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 175
Default InStrRev issue

Can anyone tell me why the results of these are the same?

rsData.Fields("DataText") contains "Transaction Void #178"
x = InStrRev(rsData.Fields("DataText"), "#")
y = InStr(1, rsData.Fields("DataText"), "#")

x and y both end up 18... I had expected that x would be 4. I also tried
assigning the recordset value to a string "S" just to make sure ADO wasn't
doing something strange to the string functions, still had the same results.

I had to use the StrReverse() function in my Right$ function to get the
"#178" extracted properly.

Right$(rsData.Fields("DataText"), _
InStr(1, StrReverse(rsData.Fields("DataText")), "#")) 'returns "#178"
--
Regards,
John
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Macro Using InStrRev: How to Rewrite to Use on Macs and Wart Excel Discussion (Misc queries) 3 April 28th 08 08:49 PM
InstrRev Issue Ajit Excel Discussion (Misc queries) 1 October 4th 07 12:08 AM
Instrrev function DavidC Excel Programming 4 April 23rd 06 12:33 AM
worksheet function for InStrRev() Martin Excel Programming 3 March 6th 06 01:14 PM
InStrRev function not working? Michal Rosa Excel Programming 1 January 26th 04 04:14 AM


All times are GMT +1. The time now is 11:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"