From 9b14ba77f5a8a9ff0390be8f94eb30a4a8712ea2 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Fri, 10 Jan 2020 11:08:51 -0500 Subject: [PATCH] add function to test a string array for non numeric --- TheBigOne.cls | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/TheBigOne.cls b/TheBigOne.cls index 65dc7c6..63ddb3b 100644 --- a/TheBigOne.cls +++ b/TheBigOne.cls @@ -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 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 - cmn = Format(DateValue(left(mmmyy, 3) & "-01-" & right(mmmyy, 2)), "m") - cy = right(mmmyy, 2) + cmn = Format(DateValue(Left(mmmyy, 3) & "-01-" & Right(mmmyy, 2)), "m") + cy = Right(mmmyy, 2) For i = 0 To monthcount - 1 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 BaseSize As Integer BaseSize = Len(sNewBaseDigits) - Do While val(d) <> 0 + Do While Val(d) <> 0 tmp = d i = 0 Do While tmp >= BaseSize i = i + 1 tmp = tmp / BaseSize 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 s = s + Mid(sNewBaseDigits, tmp + 1, 1) d = d - tmp * (BaseSize ^ i) lastI = i 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 End Function @@ -2501,3 +2493,23 @@ Function ColumnLetter(ColumnNumber As Long) As String 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