add function to test a string array for non numeric
This commit is contained in:
parent
fdd3ce6d93
commit
9b14ba77f5
@ -1,12 +1,4 @@
|
|||||||
VERSION 1.0 CLASS
|
|
||||||
BEGIN
|
|
||||||
MultiUse = -1 'True
|
|
||||||
END
|
|
||||||
Attribute VB_Name = "TheBigOne"
|
|
||||||
Attribute VB_GlobalNameSpace = False
|
|
||||||
Attribute VB_Creatable = False
|
|
||||||
Attribute VB_PredeclaredId = False
|
|
||||||
Attribute VB_Exposed = False
|
|
||||||
Option Explicit
|
Option Explicit
|
||||||
|
|
||||||
Private ADOo_con() As ADODB.Connection
|
Private ADOo_con() As ADODB.Connection
|
||||||
@ -554,8 +546,8 @@ Function SQLp_RollingMonthList(ByRef mmmyy As String, ByRef outformat As String,
|
|||||||
|
|
||||||
Dim i As Integer
|
Dim i As Integer
|
||||||
|
|
||||||
cmn = Format(DateValue(left(mmmyy, 3) & "-01-" & right(mmmyy, 2)), "m")
|
cmn = Format(DateValue(Left(mmmyy, 3) & "-01-" & Right(mmmyy, 2)), "m")
|
||||||
cy = right(mmmyy, 2)
|
cy = Right(mmmyy, 2)
|
||||||
|
|
||||||
For i = 0 To monthcount - 1
|
For i = 0 To monthcount - 1
|
||||||
If i <> 0 Then mlist = mlist & ","
|
If i <> 0 Then mlist = mlist & ","
|
||||||
@ -2419,20 +2411,20 @@ Public Function Misc_ConvBase10(ByVal d As Double, ByVal sNewBaseDigits As Strin
|
|||||||
Dim s As String, tmp As Double, i As Integer, lastI As Integer
|
Dim s As String, tmp As Double, i As Integer, lastI As Integer
|
||||||
Dim BaseSize As Integer
|
Dim BaseSize As Integer
|
||||||
BaseSize = Len(sNewBaseDigits)
|
BaseSize = Len(sNewBaseDigits)
|
||||||
Do While val(d) <> 0
|
Do While Val(d) <> 0
|
||||||
tmp = d
|
tmp = d
|
||||||
i = 0
|
i = 0
|
||||||
Do While tmp >= BaseSize
|
Do While tmp >= BaseSize
|
||||||
i = i + 1
|
i = i + 1
|
||||||
tmp = tmp / BaseSize
|
tmp = tmp / BaseSize
|
||||||
Loop
|
Loop
|
||||||
If i <> lastI - 1 And lastI <> 0 Then s = s & String(lastI - i - 1, left(sNewBaseDigits, 1)) 'get the zero digits inside the number
|
If i <> lastI - 1 And lastI <> 0 Then s = s & String(lastI - i - 1, Left(sNewBaseDigits, 1)) 'get the zero digits inside the number
|
||||||
tmp = Int(tmp) 'truncate decimals
|
tmp = Int(tmp) 'truncate decimals
|
||||||
s = s + Mid(sNewBaseDigits, tmp + 1, 1)
|
s = s + Mid(sNewBaseDigits, tmp + 1, 1)
|
||||||
d = d - tmp * (BaseSize ^ i)
|
d = d - tmp * (BaseSize ^ i)
|
||||||
lastI = i
|
lastI = i
|
||||||
Loop
|
Loop
|
||||||
s = s & String(i, left(sNewBaseDigits, 1)) 'get the zero digits at the end of the number
|
s = s & String(i, Left(sNewBaseDigits, 1)) 'get the zero digits at the end of the number
|
||||||
Misc_ConvBase10 = s
|
Misc_ConvBase10 = s
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
@ -2501,3 +2493,23 @@ Function ColumnLetter(ColumnNumber As Long) As String
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Function TBLp_TestNumeric(ByRef table() As String, ByRef column As Long) As Boolean
|
||||||
|
|
||||||
|
|
||||||
|
Dim i As Long
|
||||||
|
Dim j As Long
|
||||||
|
Dim m As Long
|
||||||
|
|
||||||
|
TBLp_TestNumeric = True
|
||||||
|
|
||||||
|
j = 0
|
||||||
|
i = 1
|
||||||
|
For i = 1 To UBound(table, 2)
|
||||||
|
If Not IsNumeric(table(column, i)) And table(column, i) <> "" Then
|
||||||
|
TBLp_TestNumeric = False
|
||||||
|
Exit Function
|
||||||
|
End If
|
||||||
|
Next i
|
||||||
|
|
||||||
|
End Function
|
||||||
|
Loading…
Reference in New Issue
Block a user