Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default A further problem that I am struggling with

On Sat, 08 Aug 2009 22:59:18 -0400, Ron Rosenfeld
wrote:

Private Function TitlePos(s As String) As Long
Dim sTitles As Variant
Dim i As Long
sTitles = Array(" MRS ", " MR ", " MISS ")
For i = 0 To UBound(sTitles)
TitlePos = InStrRev(s, sTitles(i), -1, vbTextCompare)
If TitlePos 0 Then Exit For
Next i
End Function


This part should, more properly, be written as:

=======================
Private Function TitlePos(s As String) As Long
Dim sTitles As Variant
Dim i As Long
sTitles = Array(" MRS ", " MR ", " MISS ")
For i = LBound(sTitles) To UBound(sTitles)
TitlePos = InStrRev(s, sTitles(i), -1, vbTextCompare)
If TitlePos 0 Then Exit For
Next i
End Function
========================

--ron
Reply
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 me solve this problem I've been struggling with for so long! Bjørn Excel Worksheet Functions 5 October 3rd 08 09:24 PM
Struggling to plot where I want Scooby Jones Charts and Charting in Excel 3 October 31st 06 12:46 PM
Struggling IF value Rebecca Excel Discussion (Misc queries) 5 April 6th 06 09:52 PM
Struggling Again With A VLOOKUP JohnK Excel Worksheet Functions 3 August 23rd 05 07:41 AM
Help, I'm Struggling! Fybo New Users to Excel 1 March 4th 05 07:57 PM


All times are GMT +1. The time now is 09:46 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"