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 strNot(strIn As String, strRef As String) As String
' Procedure :   strNot
' Description:  This code returns only those characters in strIn which can NOT be found in strRef.
' Copyright:    Chris Greaves Inc.
' Inputs:       A data string, a reference string.
' Returns:      STRING.
' Assumes:      Nothing
' Side Effects: None.
' Tested:       By the calls shown below.
' Posted in Woody's Lounge VBA forum
    Dim strOut As String
    strOut = ""
    Dim lngI As Long
    lngI = 1
    For lngI = 1 To Len(strIn)
'    While lngI <= Len(strIn)
        If InStr(1, strRef, Mid(strIn, lngI, 1)) > 0 Then
        Else
            strOut = strOut & Mid(strIn, lngI, 1)
        End If
'        lngI = lngI + 1
    Next lngI
'    Wend
    strNot = strOut
'Sub TESTstrNot()
'MsgBox strNot("alphabet", "abcde") ' regular use
'MsgBox strNot("", "abcde") ' empty source string
'MsgBox strNot("alphabet", "") ' empty reference string
'MsgBox strNot("alphabetand1digit", "abcdefghijklmnopqrstuvwxyz") ' strip digits
'' MsgBox strNot(strText, Chr(9) & Chr(7) & Chr(13)) ' strip tabs and returns
'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

 

 

Hosted by www.Geocities.ws

1

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 strNot(strIn As String, strRef As String) As String
' Procedure :   strNot
' Description:  This code returns only those characters in strIn which can NOT be found in strRef.
' Copyright:    Chris Greaves Inc.
' Inputs:       A data string, a reference string.
' Returns:      STRING.
' Assumes:      Nothing
' Side Effects: None.
' Tested:       By the calls shown below.
' Posted in Woody's Lounge VBA forum
    Dim strOut As String
    strOut = ""
    Dim lngI As Long
    lngI = 1
    For lngI = 1 To Len(strIn)
'    While lngI <= Len(strIn)
        If InStr(1, strRef, Mid(strIn, lngI, 1)) > 0 Then
        Else
            strOut = strOut & Mid(strIn, lngI, 1)
        End If
'        lngI = lngI + 1
    Next lngI
'    Wend
    strNot = strOut
'Sub TESTstrNot()
'MsgBox strNot("alphabet", "abcde") ' regular use
'MsgBox strNot("", "abcde") ' empty source string
'MsgBox strNot("alphabet", "") ' empty reference string
'MsgBox strNot("alphabetand1digit", "abcdefghijklmnopqrstuvwxyz") ' strip digits
'' MsgBox strNot(strText, Chr(9) & Chr(7) & Chr(13)) ' strip tabs and returns
'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

 

 

Hosted by www.Geocities.ws

1