|
Visual Basic (VB and VBA) |
|
Copyright 1999-2001 Christopher Greaves. All rights reserved. Home Page and email to [email protected] |
| If in doubt, record a macro and inspect the entrails! |
Please read the DISCLAIMER.
Here is an INDEX to all the procedures.
You will probably need one copy of my GLOBAL DECLARATIONS.
Public Function FindSubStrings(strAr() As String, ByVal strIn As String)
' Given a string, break it into component parts and look for those in the current document.
Dim strNext As String
strNext = ""
While Len(strIn) > 0
If InStr(1, strcAlpha, Left(strIn, 1)) > 0 Then
strNext = strNext & Left(strIn, 1)
Else
If Len(strNext) > 0 Then
strAr(UBound(strAr)) = strNext
ReDim Preserve strAr(UBound(strAr) + 1)
strNext = ""
Else
End If
End If
strIn = Right(strIn, Len(strIn) - 1)
Wend
If Len(strNext) > 0 Then
strAr(UBound(strAr)) = strNext
ReDim Preserve strAr(UBound(strAr) + 1)
strNext = ""
Else
End If
If UBound(strAr) > 0 Then
ReDim Preserve strAr(UBound(strAr) - 1)
Else
End If
'Sub TESTFindSubStrings()
' Dim strar() As String
' ReDim strar(0)
' Call FindSubStrings(strar, "here is@a fine to-do")
' Dim intAr As Integer
' For intAr = 0 To UBound(strar)
' MsgBox intAr & " " & strar(intAr)
' Next intAr
'End Sub
End Function
| We all knew nothing when we started … |
|
Home Page and Contact Information Send email to [email protected]. This page was last updated Thursday, November 15, 2001 |