Zero pad function trim extra leading zeros
Naming  

Based on the naming guidelines parameters should be named using camelCase casing.  

Select Case

If you omitt the Case Is &gt; ToLength and the else part aka having only 2 cases you will have  

Friend Function ZeroPad(ByVal Number As String, ByVal ToLength As Integer, Optional ByVal TrimExtraZeroes As Boolean = False) As String
    Const ZeroChar = "0"c

    Select Case Number.Length
        Case Is &lt; ToLength
            Return New String(ZeroChar, ToLength - Number.Length) &amp; Number
        Case Is = ToLength
            Return Number
     End Select

     If (TrimExtraZeroes) Then
         Do While Number.StartsWith(ZeroChar) AndAlso Number.Length &gt; ToLength
             Number = Number.Substring(1)
         Loop
     End If
    Return Number
End Function  


Why don't you use the built in String.PadLeft() method which would obsolete the Select Case. In addition to first stripping any 0 of the left side of Number you won't need the loop at all.  

This boils down to only this     

Friend Function ZeroPad(ByVal Number As String, ByVal ToLength As Integer, Optional ByVal TrimExtraZeroes As Boolean = False) As String
    Const ZeroChar = "0"c
    If (TrimExtraZeroes) Then
        Number = Number.TrimStart({ZeroChar})
    End If
    Return Number.PadLeft(ToLength, ZeroChar)
End Function  


Update
Some timetables for calling both methods 1.000.000 times  

                                    Yours(ms)  Mine(ms)
ZeroPad("0000000001", 2, False)       227       231
ZeroPad("0000000001", 2, True)       1696       297
ZeroPad("01", 2, False)               251       235
ZeroPad("01", 2, True)                248       263  
ZeroPad("01", 12, False)              256       247
ZeroPad("01", 12, True)               257       260