LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 733
Default String Function

"Myrna Larson" wrote...
On 3 Feb 2005 15:37:59 -0800, "Harlan Grove" wrote:
or for the N_th instance
Dim i As Long, p As Long
For i = 1 To N
p = InStr(p + 1, s, c)
if p = 0 Then Exit For
Next i

....
Where and how are you intending to set the function return value? After the
"Next i" statement, if i < N + 1, then there was no Nth occurrence, right?


I did mention that this was intended to be inline code. I guess I wasn't
explicit that the value, if 0, would be stored in p, and p = 0 would
indicate no N_th instance.


 
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
Function to evaluate function as string Basil Excel Worksheet Functions 3 September 18th 09 10:43 AM
string function help Eelinla Excel Discussion (Misc queries) 5 April 21st 07 08:26 PM
Add Function to String Ronbo Excel Worksheet Functions 2 February 22nd 05 05:33 AM
String function Irina Excel Worksheet Functions 1 November 9th 04 06:18 PM
Function to convert string Carl Brehm Excel Programming 13 July 19th 04 11:27 AM


All times are GMT +1. The time now is 08:58 AM.

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"