View Single Post
Old 04-21-2011, 04:53 AM   #1
englishg9o
Major
 
Join Date: Feb 2011
Posts: 669
englishg9o is on a distinguished road
Default Office Professional 2010 A Simple Solution for Plu

Reader Patrick Jackman of Vancouver, BC has submitted a useful “fit-and-finish” tip. Here is a simple tip that I use quite often in MsgBox prompts when the message involves reporting the results of a count. Function Pluralize(ByVal varCount As Variant,Microsoft Office Professional 2010, Optional Singular _
                    As Variant, Optional Plural As Variant) _
                    As String     If Not IsNull(varCount) Then
        If varCount <> 1 Then
            If IsMissing(Plural) Then
                Pluralize = "s"
            Else
                Pluralize = Plural
            End If
        Else
            If Not IsMissing(Singular) Then
                Pluralize = Singular
            End If
        End If
    End If
End Function Here is an example of how I would use it without the optional parameters: strMsg = "Your search returned " & intCount & " item" & _
            Pluralize(intCount) & "." When intCount is 1, strMsg would be: Your search returned 1 item. When intCount is 2, strMsg would be: Your search returned 2 items. Here is an example using the optional parameters: strMsg = "Print " & intCount & " cop" & _
            Pluralize(intCount, "y",Office Standard, "ies") & "?" When intCount is 1,Office Professional 2010, strMsg would be: Print 1 copy? When intCount is 2,Windows 7 64bit, strMsg would be: Print 2 copies? For more information,Microsoft Office Professional Plus 2007, you can contact Patrick here. <div
englishg9o is offline   Reply With Quote

Sponsored Links