MALICIOUS
88
Risk Score
Malware Insights
MITRE ATT&CK
T1059.005 Visual Basic
T1566.001 Spearphishing Attachment
The critical ClamAV heuristic identified the sample as 'Xls.Trojan.Laroux-32', indicating a known trojan. The presence of VBA macros, specifically an Auto_Open macro, confirms the execution of malicious code upon opening the Excel file. This macro is likely responsible for downloading and executing a secondary payload, a common tactic for this family.
Heuristics 2
-
VBA macros detected medium 1 related finding OLE_VBA_MACROSDocument contains VBA macro code
-
Auto_Open macro low OLE_VBA_AUTOAuto_Open macroMatched line in script
Sub auto_open()
Extracted artifacts 1
Files carved from inside the sample during analysis.
| Filename | Kind | Source | Size |
|---|---|---|---|
macros.bas |
vba-macro | oletools.olevba.extract_macros (decoded VBA source) | 83715 bytes |
SHA-256: 4d7bd855530699332d10aa93bc4b1e2ac270bd30831835b3b6a5c6fa295fa55d |
|||
|
Detection
ClamAV:
Xls.Trojan.Laroux-32
Obfuscation or payload:
unlikely
|
|||
Preview scriptFirst 1,000 lines of the extracted script
Attribute VB_Name = "Sheet1"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True
Private Sub 开始检查_Click()
End Sub
Attribute VB_Name = "Sheet2"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True
Attribute VB_Name = "Sheet3"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True
Attribute VB_Name = "Sheet4"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True
Attribute VB_Name = "ThisWorkbook"
Attribute VB_Base = "0{00020819-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True
Attribute VB_Name = "工具函数"
Function DicCheck(ValueColum, dicColum)
'待检查数据列的表头
Dim valueColumnTitle As String
'待检查数据列的字典表头
Dim dicColumnTitle As String
'数据表格的行数
Dim valueRowCount As Long
'需要校验的sheet
Dim curMsgRow As Integer
Dim valueTitle As String
valueTitle = Sheets(valueSheetName).Cells(1, ValueColum)
valueRowCount = Sheets(valueSheetName).UsedRange.Rows.count
For i = dataRowStart To valueRowCount
cellValue = Sheets(valueSheetName).Cells(i, ValueColum)
If cellValue = "" Then
Exit Function
End If
If cellValue <> "" And DoDicCheck(cellValue, dicColum) = False Then
errorMsg = "第" & i & "行的数据项:" & valueTitle & "不符合规范,请检查!"
writeLog (errorMsg)
End If
Next i
End Function
'检查字典项是否合法
Function DoDicCheck(valueCol As TypeValueColum, rowIndex)
'字典sheet
value = Sheets(valueSheetName).Cells(rowIndex, valueCol.columnIndex)
For j = dataRowStart To Sheets(dicSheetName).UsedRange.Rows.count - 1
dicvalue = Sheets(dicSheetName).Cells(j, valueCol.dicColumnIndex)
If dicvalue = "" Then
Exit For
End If
If dicvalue = value Then
DoDicCheck = True
Exit Function
End If
Next j
If valueCol.dicColumnName = "民族" Or valueCol.dicColumnName = "国籍/地区" Then
errorMsg = "第" & rowIndex & "行的数据项:" & valueCol.columnName & "不符合规范,请检查"
writeLog (errorMsg)
Else
errorMsg = "第" & rowIndex & "行的数据项:" & valueCol.columnName & "不符合规范,请检查" & getTextByDicName(valueCol.dicColumnName, valueCol.dicColumnIndex)
writeLog (errorMsg)
End If
DoDicCheck = False
End Function
'根据字典名称,获得字典的内容
Function getTextByDicName(dicName, dicIndex)
Dim str As String
Dim count As Integer
str = "(" & dicName & ":"
For j = dataRowStart To Sheets(dicSheetName).UsedRange.Rows.count - 1
dicvalue = Sheets(dicSheetName).Cells(j, dicIndex)
If dicvalue <> "" Then
str = str + dicvalue + "、"
count = count + 1
Else
lastIndex = InStrRev(str, "、")
str = Application.WorksheetFunction.Substitute(str, "、", ")", count)
str = Application.WorksheetFunction.Substitute(str, "、", "和", count - 1)
getTextByDicName = str
Exit Function
End If
Next j
End Function
'校验长度是否符合要求,参数
'value:需要校验的内容
'length:限定长度
'strick:是否相等
Function CheckValueLength(valueCol As TypeValueColum, rowIndex, length, strick)
value = Sheets(valueSheetName).Cells(rowIndex, valueCol.columnIndex)
valueLength = Len(value)
If strick Then
If valueLength = length Then
CheckValueLength = True
Exit Function
Else
CheckValueLength = False
errorMsg = "第" & rowIndex & "行的数据项:" & valueCol.columnName & "必须为" & length & "位,请检查!"
writeLog (errorMsg)
Exit Function
End If
End If
If valueLength <= length Then
CheckValueLength = True
Exit Function
Else
CheckValueLength = False
errorMsg = "第" & rowIndex & "行的数据项:" & valueCol.columnName & "长度不能大于" & length & "位,请检查!"
writeLog (errorMsg)
Exit Function
End If
End Function
'获得内容的字节数
'返回字节长度
Function checkByteLength(value)
Dim byteLen As Integer
byteLen = 0
If IsEmpty(value) Then
Exit Function
End If
valueLength = Len(value)
For i = 1 To valueLength
If Abs(Asc(Mid(value, i, 1))) > 255 Then
byteLen = byteLen + 3
Else
byteLen = byteLen + 1
End If
Next i
checkByteLength = byteLen
End Function
'根据列查询是否有字典
'找到返回列索引
'找不到返回0
Function findDic(value)
Dim index As Integer
index = 1
Title = Sheets(dicSheetName).Cells(1, index)
While Title <> ""
If Title = value Then
findDic = index
Exit Function
End If
index = index + 1
Title = Sheets(dicSheetName).Cells(1, index)
Wend
findDic = 0
End Function
'是否为数字
'不是数字写入日志 返回 False
'是数字 返回 True
Function checkBeNumeric(valueCol As TypeValueColum, rowIndex)
Dim beNumeric As Boolean
value = Sheets(valueSheetName).Cells(rowIndex, valueCol.columnIndex)
beNumeric = IsNumeric(value)
If beNumeric Then
Else
errorMsg = "第" & rowIndex & "行的数据项:" & valueCol.columnName & "必须为数字,请检查!"
writeLog (errorMsg)
checkBeNumeric = False
Exit Function
End If
checkBeNumeric = True
End Function
'检查是否为20111001日期格式
'合法,返回True
'不合法,返回False
Function CheckIsDate(valueCol As TypeValueColum, rowIndex)
Dim beNumeric As Boolean
value = Sheets(valueSheetName).Cells(rowIndex, valueCol.columnIndex)
If Len(value) <> 8 Then
errorMsg = "第" & rowIndex & "行的数据项:" & valueCol.columnName & "格式不正确,请检查(例如:20121001)!"
writeLog (errorMsg)
CheckIsDate = False
Exit Function
End If
beNumeric = IsNumeric(value)
If beNumeric Then
Else
errorMsg = "第" & rowIndex & "行的数据项:" & valueCol.columnName & "格式不正确,请检查(例如:20121001)!"
writeLog (errorMsg)
CheckIsDate = False
Exit Function
End If
dateStr = Left(value, 4) & "/" & Mid(value, 5, 2) & "/" & Right(value, 2)
beDate = IsDate(dateStr)
If beDate Then
Else
errorMsg = "第" & rowIndex & "行的数据项:" & valueCol.columnName & "不合法,请检查(例如:20121001)!"
writeLog (errorMsg)
CheckIsDate = False
Exit Function
End If
CheckIsDate = True
End Function
'检查是否为20110101日期格式
'合法,返回True
'不合法,返回False
Function CheckBeDate(value)
Dim beNumeric As Boolean
If Len(value) <> 8 Then
CheckBeDate = False
Exit Function
End If
beNumeric = IsNumeric(value)
If beNumeric Then
Else
CheckBeDate = False
Exit Function
End If
dateStr = Left(value, 4) & "/" & Mid(value, 5, 2) & "/" & Right(value, 2)
beDate = IsDate(dateStr)
If beDate Then
Else
CheckBeDate = False
Exit Function
End If
CheckBeDate = True
End Function
'检查是否为201101日期格式
'合法,返回True
'不合法,返回False
Function CheckIsYmDate(valueCol As TypeValueColum, rowIndex)
Dim beNumeric As Boolean
value = Sheets(valueSheetName).Cells(rowIndex, valueCol.columnIndex)
If Len(value) <> 6 Then
errorMsg = "第" & rowIndex & "行的数据项:" & valueCol.columnName & "格式不正确,请检查(例如:201201)!"
writeLog (errorMsg)
CheckIsYmDate = False
Exit Function
End If
beNumeric = IsNumeric(value)
If beNumeric Then
Else
errorMsg = "第" & rowIndex & "行的数据项:" & valueCol.columnName & "格式不正确,请检查(例如:201201)!"
writeLog (errorMsg)
CheckIsYmDate = False
Exit Function
End If
dateStr = Left(value, 4) & "/" & Right(value, 2) & "/01"
beDate = IsDate(dateStr)
If beDate Then
Else
errorMsg = "第" & rowIndex & "行的数据项:" & valueCol.columnName & "不合法,请检查(例如:20120101)!"
writeLog (errorMsg)
CheckIsYmDate = False
Exit Function
End If
CheckIsYmDate = True
End Function
'比较两个日期大小
'date1>date2 返回1
'date1=date2 返回0
'date1<date2 返回-1
'其他返回2
Function compareDate(dateStr1, dateStr2)
Dim date1 As Date
Dim date2 As Date
If Len(dateStr1) <> 8 Or Len(dateStr2) <> 8 Then
compareDate = 2
Exit Function
End If
If IsNumeric(dateStr1) And IsNumeric(dateStr2) Then
Else
compareDate = 2
Exit Function
End If
date1 = Left(dateStr1, 4) & "/" & Mid(dateStr1, 5, 2) & "/" & Right(dateStr1, 2)
date2 = Left(dateStr2, 4) & "/" & Mid(dateStr2, 5, 2) & "/" & Right(dateStr2, 2)
If date1 - date2 > 0 Then
compareDate = 1
ElseIf date1 - date2 = 0 Then
compareDate = 0
Else
compareDate = -1
End If
End Function
'检查必填项
'空时返回0
'不为空时返回1
Function checkRequired(rowIndex, columnIndex)
'表头内容
Dim valueTitle As String
'单元格内容
Dim cellValue As String
valueTitle = Sheets(valueSheetName).Cells(1, columnIndex)
cellValue = Sheets(valueSheetName).Cells(rowIndex, columnIndex)
If cellValue = "" Then
checkRequired = 0
errorMsg = "第" & rowIndex & "行的数据项:" & valueTitle & "不能为空,请填写!"
writeLog (errorMsg)
Else
checkRequired = 1
End If
End Function
'检查身份证件号码是否合法
'不合法,返回0
'合法,返回1
'15位 升级18位
Function IDcheck(ID)
Dim s, i As Integer
Dim e, z As String
'----------------------------身份证号码合法性检查---------------------------------------
If Not (Len(ID) = 18 Or Len(ID) = 15) Then '位数检验
IDcheck = 0
Exit Function
Else
If Len(ID) = 15 Then ID = Left(ID, 6) & "19" & Right(ID, 9)
If IsNumeric(Left(ID, 17)) = False Or InStr(ID, ".") > 0 Then '字符检验
IDcheck = 0
Exit Function
End If
On Error Resume Next '日期检验
If DateValue(Mid(ID, 7, 4) & "-" & Mid(ID, 11, 2) & "-" & Mid(ID, 13, 2)) < 1 Or _
DateValue(Mid(ID, 7, 4) & "-" & Mid(ID, 11, 2) & "-" & Mid(ID, 13, 2)) > Date Then
IDcheck = 0
Exit Function
End If
End If
'-----------------------------校验码的生成及检查----------------------------------------
s = 0
For i = 1 To 17
s = s + Val(Mid(ID, 18 - i, 1)) * (2 ^ i Mod 11)
Next
e = Mid("10X98765432", (s Mod 11) + 1, 1) '生成校验码
If Len(ID) = 18 Then
z = UCase(Right(ID, 1))
If z = e Then '校验码对比
IDcheck = 1
Else
IDcheck = 0 '如果要返回校验码,请把本行语句改为:IDcheck = e
End If
Else
IDcheck = ID & e '15位身份证号码升位
End If
End Function
'校验电子邮箱
Function matchEmail(value)
Dim beIndex As Integer
beIndex = InStr(value, "@")
If beIndex = 0 Then
matchEmail = False
End If
matchEmail = True
End Function
Function getValueColumCount(sheetName)
index = 1
Title = Sheets(sheetName).Cells(1, index)
While Title <> ""
index = index + 1
Title = Sheets(sheetName).Cells(1, index)
Wend
getValueColumCount = index - 1
End Function
'删除日志
Function clearLog()
Sheets(msgSheetName).Columns(1).Delete
End Function
'写日志
Function writeLog(content As String)
Sheets(msgSheetName).Cells(curMsgRow, 1) = content
curMsgRow = curMsgRow + 1
End Function
'获得总列数
Function getColumnCount(sheetName)
index = 1
Title = Sheets(sheetName).Cells(1, index)
While Title <> ""
index = index + 1
Title = Sheets(sheetName).Cells(1, index)
Wend
getColumnCount = index - 1
End Function
'回填数据信息
Function fileXsExportModel(xep As TypeValueCell)
bb = getExportCell(xep)
If xep.cellContent <> "" Then
If xep.cellName = "班号" Then
If Len(xep.cellContent) = 7 Then
Dim jyjdInt As Integer
Dim bjStr As String
Dim bjMess As String
Dim njStr As String
Dim njMess As String
bjMess = ""
jyjdInt = Mid(xep.cellContent, 5, 1)
njStr = Mid(xep.cellContent, 1, 4)
bjStr = Mid(xep.cellContent, 6, 2)
If jyjdInt = 1 Then
njMess = "小学" & njStr & "级"
bjMess = bjStr & "班(" & xep.cellContent & ")"
ElseIf jyjdInt = 2 Then
njMess = "初中" & njStr & "级"
bjMess = bjStr & "班(" & xep.cellContent & ")"
ElseIf jyjdInt = 3 Then
njMess = "高中" & njStr & "级"
bjMess = bjStr & "班(" & xep.cellContent & ")"
End If
xep.cellContent = bjMess
Sheets(XsExportSheet).Cells(19, 3) = njMess
Sheets(XsExportSheet).Cells(xep.exportRow, xep.exportColumn) = xep.cellContent
End If
Else
If xep.cellName <> "血型" Then
Sheets(XsExportSheet).Cells(xep.exportRow, xep.exportColumn) = xep.cellContent
End If
End If
Else
If xep.cellName <> "隐藏" And xep.cellName <> "血型" Then
Sheets(XsExportSheet).Cells(xep.exportRow, xep.exportColumn) = ""
End If
End If
End Function
'清空模板信息
Function clearXsExportModel(xep As TypeValueCell)
bb = getExportCell(xep)
Sheets(XsExportSheet).Cells(xep.exportRow, xep.exportColumn) = ""
End Function
Attribute VB_Name = "开始使用"
Sub Begin_Click()
Sheets(valueSheetName).Visible = True
Sheets(valueSheetName).Select
Sheets(readmeSheetName).Visible = False
End Sub
Attribute VB_Name = "声明"
Public Type TypeValueColum
'列索引号
columnIndex As Integer
'列名称
columnName As String
'对应字典列索引。没有字典对应时为0
dicColumnIndex As Integer
'对应字典列索引。没有字典对应时为空
dicColumnName As String
End Type
'学校标识码
Public xxbsm As String
'定义一个结构,描述数据页
Public Const valueSheetName As String = "学生基础信息"
Public Const dicSheetName As String = "字典"
Public Const msgSheetName As String = "错误信息"
Public Const readmeSheetName As String = "说明"
Public totalCount As Integer '记录总的校验数
Public Const dataRowStart As Integer = 2
Public curMsgRow As Integer
Public Type TypeValueCell
'列名称
cellName As String
'内容
cellContent As String
'对应导出sheet页导出的列
exportColumn As Integer
'对应导出sheet页导出的行
exportRow As Integer
End Type
Public Const XsXxSheet As String = "学生基础信息"
Public Const XsExportSheet As String = "学生信息打印模板"
'是否继续
Public notContinueBool As Boolean
Attribute VB_Name = "校验函数"
'1 学校标识码
Function checkXXsbh(valueCol As TypeValueColum, rowIndex)
If checkRequired(rowIndex, valueCol.columnIndex) = 1 Then
isBeing = CheckValueLength(valueCol, rowIndex, 10, True)
If isBeing Then
value = Sheets(valueSheetName).Cells(rowIndex, valueCol.columnIndex)
If xxbsm <> value Then
errorMsg = "第" & rowIndex & "行的数据项:" & valueCol.columnName & "和输入的学校标识码不相同,请检查!"
writeLog (errorMsg)
End If
End If
End If
End Function
'2 姓名
Function checkXm(valueCol As TypeValueColum, rowIndex)
If checkRequired(rowIndex, valueCol.columnIndex) = 1 Then
oldValue = Sheets(valueSheetName).Cells(rowIndex, valueCol.columnIndex)
newValue = Replace(oldValue, " ", "")
Sheets(valueSheetName).Cells(rowIndex, valueCol.columnIndex).value = newValue
isBeing = CheckValueLength(valueCol, rowIndex, 30, False)
End If
End Function
'3 性别
Function checkXb(valueCol As TypeValueColum, rowIndex)
If valueCol.dicColumnIndex = 0 Then
MsgBox ("性别没有对应字典列检查,请联系管理员!")
Exit Function
End If
If checkRequired(rowIndex, valueCol.columnIndex) = 1 Then
isBeing = DoDicCheck(valueCol, rowIndex)
End If
End Function
'4 出生日期
Function checkCsrq(valueCol As TypeValueColum, rowIndex)
If checkRequired(rowIndex, valueCol.columnIndex) = 1 Then
beDate = CheckIsDate(valueCol, rowIndex)
End If
End Function
'5 出生地行政区划
Function checkCsrXzqh(valueCol As TypeValueColum, rowIndex)
If checkRequired(rowIndex, valueCol.columnIndex) = 1 Then
isBeing = CheckValueLength(valueCol, rowIndex, 12, True)
If isBeing Then
IsNumber = checkBeNumeric(valueCol, rowIndex)
End If
End If
End Function
'6 籍贯
Function checkJg(valueCol As TypeValueColum, rowIndex)
If checkRequired(rowIndex, valueCol.columnIndex) = 1 Then
isBeing = CheckValueLength(valueCol, rowIndex, 20, False)
End If
End Function
'7 民族
Function checkMz(valueCol As TypeValueColum, rowIndex)
If valueCol.dicColumnIndex = 0 Then
MsgBox ("民族没有对应字典列检查,请联系管理员!")
Exit Function
End If
If checkRequired(rowIndex, valueCol.columnIndex) = 1 Then
isBeing = DoDicCheck(valueCol, rowIndex)
End If
End Function
'8 国籍/地区
Function checkGjdq(valueCol As TypeValueColum, rowIndex)
If valueCol.dicColumnIndex = 0 Then
MsgBox ("国籍/地区没有对应字典列检查,请联系管理员!")
Exit Function
End If
If checkRequired(rowIndex, valueCol.columnIndex) = 1 Then
isBeing = DoDicCheck(valueCol, rowIndex)
End If
End Function
'9 身份证件类型
Function checkSfzjlx(valueCol As TypeValueColum, rowIndex)
If valueCol.dicColumnIndex = 0 Then
MsgBox ("身份证件类型没有对应字典列检查,请联系管理员!")
Exit Function
End If
If checkRequired(rowIndex, valueCol.columnIndex) = 1 Then
isBeing = DoDicCheck(valueCol, rowIndex)
If isBeing Then
value = Sheets(valueSheetName).Cells(rowIndex, valueCol.columnIndex)
beID = IDcheck(Sheets(valueSheetName).Cells(rowIndex, valueCol.columnIndex + 4))
Select Case value
Case "其他"
Sheets(valueSheetName).Cells(rowIndex, valueCol.columnIndex + 4).value = ""
Case "居民身份证"
If beID = 0 Then
errorMsg = "第" & rowIndex & "行的数据项:身份证件号不正确,请检查!"
writeLog (errorMsg)
ElseIf beID = 1 Then
Else
Sheets(valueSheetName).Cells(rowIndex, valueCol.columnIndex + 4).value = beID
End If
Case Else
If beID = "" Then
errorMsg = "第" & rowIndex & "行的数据项:身份证件号不能为空,请检查!"
writeLog (errorMsg)
End If
End Select
End If
End If
End Function
'10 港澳台侨外
Function checkGat(valueCol As TypeValueColum, rowIndex)
If valueCol.dicColumnIndex = 0 Then
MsgBox ("港澳台侨外没有对应字典列检查,请联系管理员!")
Exit Function
End If
If checkRequired(rowIndex, valueCol.columnIndex) = 1 Then
isBeing = DoDicCheck(valueCol, rowIndex)
End If
End Function
'11 健康状况
Function checkJkzk(valueCol As TypeValueColum, rowIndex)
If valueCol.dicColumnIndex = 0 Then
MsgBox ("健康状况没有对应字典列检查,请联系管理员!")
Exit Function
End If
If checkRequired(rowIndex, valueCol.columnIndex) = 1 Then
isBeing = DoDicCheck(valueCol, rowIndex)
End If
End Function
'12 政治面貌
Function checkZzmm(valueCol As TypeValueColum, rowIndex)
If valueCol.dicColumnIndex = 0 Then
MsgBox ("政治面貌没有对应字典列检查,请联系管理员!")
Exit Function
End If
If checkRequired(rowIndex, valueCol.columnIndex) = 1 Then
isBeing = DoDicCheck(valueCol, rowIndex)
End If
End Function
'13 身份证件号
Function checkSfzjhm(valueCol As TypeValueColum, rowIndex)
sfzjlxStr = Sheets(valueSheetName).Cells(rowIndex, valueCol.columnIndex - 4)
If sfzjlxStr <> "居民身份证" Then
byteLen = checkByteLength(Sheets(valueSheetName).Cells(rowIndex, valueCol.columnIndex))
If byteLen > 18 Then
errorMsg = "第" & rowIndex & "行的数据项:身份证件号长度不能大于18个字符(汉字不能大于6个字符),请检查!"
writeLog (errorMsg)
End If
End If
End Function
'14 户口性质
Function checkHkxz(valueCol As TypeValueColum, rowIndex)
If valueCol.dicColumnIndex = 0 Then
MsgBox ("户口性质没有对应字典列检查,请联系管理员!")
Exit Function
End If
If checkRequired(rowIndex, valueCol.columnIndex) = 1 Then
isBeing = DoDicCheck(valueCol, rowIndex)
End If
End Function
''15 户口所在地行政区划
Function checkHkszdXzqh(valueCol As TypeValueColum, rowIndex)
If checkRequired(rowIndex, valueCol.columnIndex) = 1 Then
isBeing = CheckValueLength(valueCol, rowIndex, 12, True)
If isBeing Then
IsNumber = checkBeNumeric(valueCol, rowIndex)
End If
End If
End Function
''16 班号
Function checkBh(valueCol As TypeValueColum, rowIndex)
If checkRequired(rowIndex, valueCol.columnIndex) = 1 Then
isBeing = CheckValueLength(valueCol, rowIndex, 7, True)
If isBeing Then
IsNumber = checkBeNumeric(valueCol, rowIndex)
If IsNumber Then
Dim jyjdInt As Integer
value = Sheets(valueSheetName).Cells(rowIndex, valueCol.columnIndex)
jyjdInt = Mid(value, 5, 1)
If jyjdInt <> 1 And jyjdInt <> 2 And jyjdInt <> 3 Then
errorMsg = "第" & rowIndex & "行的数据项:" & valueCol.columnName & "填写不正确(第5位表示教育阶段,1表示小学,2表示初中,3表示高中)!"
writeLog (errorMsg)
'Else
' csrqValue = Sheets(valueSheetName).Cells(rowIndex, valueCol.columnIndex - 12)
' Dim csrq As Date
' csrq = Left(csrqValue, 4) & "/" & Mid(csrqValue, 5, 2) & "/" & Right(csrqValue, 2)
' days = DateDiff("d", csrq, Now)
' age = days / 365
' If jyjdInt = 1 Then
' If age < 5 Or age > 11 Then
' errorMsg = "第" & rowIndex & "行的数据项: 该小学学生的年龄不在4岁到11岁之间,请检查!"
' writeLog (errorMsg)
' End If
' ElseIf jyjdInt = 2 Then
' If age < 12 Or age > 15 Then
' errorMsg = "第" & rowIndex & "行的数据项: 该初中学生的年龄不在12岁到15岁之间,请检查!"
' writeLog (errorMsg)
' End If
' Else
' If age < 16 Or age > 18 Then
' errorMsg = "第" & rowIndex & "行的数据项: 该高中学生的年龄不在16岁到18岁之间,请检查!"
' writeLog (errorMsg)
' End If
' End If
End If
End If
End If
End If
End Function
''17 入学年月
Function checkRxny(valueCol As TypeValueColum, rowIndex)
If checkRequired(rowIndex, valueCol.columnIndex) = 1 Then
isBeing = CheckValueLength(valueCol, rowIndex, 6, True)
If isBeing Then
isYM = CheckIsYmDate(valueCol, rowIndex)
End If
End If
End Function
''18 入学方式
Function checkRxfs(valueCol As TypeValueColum, rowIndex)
If valueCol.dicColumnIndex = 0 Then
MsgBox ("入学方式没有对应字典列检查,请联系管理员!")
Exit Function
End If
If checkRequired(rowIndex, valueCol.columnIndex) = 1 Then
isBeing = DoDicCheck(valueCol, rowIndex)
End If
End Function
''19 就读方式
Function checkJdfs(valueCol As TypeValueColum, rowIndex)
If valueCol.dicColumnIndex = 0 Then
MsgBox ("就读方式没有对应字典列检查,请联系管理员!")
Exit Function
End If
If checkRequired(rowIndex, valueCol.columnIndex) = 1 Then
isBeing = DoDicCheck(valueCol, rowIndex)
End If
End Function
''20 现住址
Function checkXzz(valueCol As TypeValueColum, rowIndex)
If checkRequired(rowIndex, valueCol.columnIndex) = 1 Then
isBeing = CheckValueLength(valueCol, rowIndex, 60, False)
End If
End Function
''21 通信地址
Function checkTxfs(valueCol As TypeValueColum, rowIndex)
If checkRequired(rowIndex, valueCol.columnIndex) = 1 Then
isBeing = CheckValueLength(valueCol, rowIndex, 60, False)
End If
End Function
''22 家庭地址
Function checkJtzz(valueCol As TypeValueColum, rowIndex)
If checkRequired(rowIndex, valueCol.columnIndex) = 1 Then
isBeing = CheckValueLength(valueCol, rowIndex, 60, False)
End If
End Function
''23 联系电话
Function checkLxdh(valueCol As TypeValueColum, rowIndex)
If checkRequired(rowIndex, valueCol.columnIndex) = 1 Then
isBeing = CheckValueLength(valueCol, rowIndex, 30, False)
If isBeing Then
IsNumber = checkBeNumeric(valueCol, rowIndex)
End If
End If
End Function
''24 邮政编码
Function checkYzbm(valueCol As TypeValueColum, rowIndex)
If checkRequired(rowIndex, valueCol.columnIndex) = 1 Then
isBeing = CheckValueLength(valueCol, rowIndex, 6, True)
If isBeing Then
IsNumber = checkBeNumeric(valueCol, rowIndex)
End If
End If
End Function
''25 是否独生子女
Function checkSfdszn(valueCol As TypeValueColum, rowIndex)
If valueCol.dicColumnIndex = 0 Then
MsgBox ("是否没有对应字典列检查,请联系管理员!")
Exit Function
End If
If checkRequired(rowIndex, valueCol.columnIndex) = 1 Then
isBeing = DoDicCheck(valueCol, rowIndex)
End If
End Function
''26 是否受过学前教育
Function checkSfsgxqjy(valueCol As TypeValueColum, rowIndex)
If valueCol.dicColumnIndex = 0 Then
MsgBox ("是否没有对应字典列检查,请联系管理员!")
Exit Function
End If
If checkRequired(rowIndex, valueCol.columnIndex) = 1 Then
isBeing = DoDicCheck(valueCol, rowIndex)
End If
End Function
''27 是否留守儿童
Function checkSflset(valueCol As TypeValueColum, rowIndex)
If valueCol.dicColumnIndex = 0 Then
MsgBox ("是否留守儿童没有对应字典列检查,请联系管理员!")
Exit Function
End If
If checkRequired(rowIndex, valueCol.columnIndex) = 1 Then
isBeing = DoDicCheck(valueCol, rowIndex)
End If
End Function
''28 是否需要申请资助
Function checkSfsqzz(valueCol As TypeValueColum, rowIndex)
If valueCol.dicColumnIndex = 0 Then
MsgBox ("是否没有对应字典列检查,请联系管理员!")
Exit Function
End If
If checkRequired(rowIndex, valueCol.columnIndex) = 1 Then
isBeing = DoDicCheck(valueCol, rowIndex)
End If
End Function
''29 是否享受一补
Function checkSfxsyb(valueCol As TypeValueColum, rowIndex)
If valueCol.dicColumnIndex = 0 Then
MsgBox ("是否没有对应字典列检查,请联系管理员!")
Exit Function
End If
If checkRequired(rowIndex, valueCol.columnIndex) = 1 Then
isBeing = DoDicCheck(valueCol, rowIndex)
End If
End Function
''30 是否孤儿
Function checkSfge(valueCol As TypeValueColum, rowIndex)
If valueCol.dicColumnIndex = 0 Then
MsgBox ("是否没有对应字典列检查,请联系管理员!")
Exit Function
End If
If checkRequired(rowIndex, valueCol.columnIndex) = 1 Then
isBeing = DoDicCheck(valueCol, rowIndex)
End If
End Function
''31 是否烈士或优抚子女
Function checkSflshyfzn(valueCol As TypeValueColum, rowIndex)
If valueCol.dicColumnIndex = 0 Then
MsgBox ("是否没有对应字典列检查,请联系管理员!")
Exit Function
End If
If checkRequired(rowIndex, valueCol.columnIndex) = 1 Then
isBeing = DoDicCheck(valueCol, rowIndex)
End If
End Function
''32 上下学距离
Function checkSxjl(valueCol As TypeValueColum, rowIndex)
Dim doubleStr As Double
value = Sheets(valueSheetName).Cells(rowIndex, valueCol.columnIndex)
If value <> "" Then
If IsNumeric(value) Then
If value <= 0 Then
errorMsg = "第" & rowIndex & "行的数据项:" & valueCol.columnName & "为5位以内的正数且保留1位小数,请填写!"
writeLog (errorMsg)
Exit Function
ElseIf value - Fix(value) = 0 And value > 0 Then
value = Format(Sheets(valueSheetName).Cells(rowIndex, valueCol.columnIndex), "0.0")
Else
value = Round(value, 1)
End If
Sheets(valueSheetName).Cells(rowIndex, valueCol.columnIndex).value = value
byteLen = checkByteLength(value)
If byteLen > 6 Then
errorMsg = "第" & rowIndex & "行的数据项:" & valueCol.columnName & "为5位以内的正数且保留1位小数,请填写!"
writeLog (errorMsg)
End If
Else
errorMsg = "第" & rowIndex & "行的数据项:" & valueCol.columnName & "的内容必须为数字,请重新填写!"
writeLog (errorMsg)
End If
End If
End Function
''33 上下学方式
Function checkSxxfs(valueCol As TypeValueColum, rowIndex)
If valueCol.dicColumnIndex = 0 Then
MsgBox ("上下学方式没有对应字典列检查,请联系管理员!")
Exit Function
End If
value = Sheets(valueSheetName).Cells(rowIndex, valueCol.columnIndex)
If value <> "" Then
isBeing = DoDicCheck(valueCol, rowIndex)
End If
End Function
''34 是否需要乘坐校车
Function checkSfxyczxc(valueCol As TypeValueColum, rowIndex)
If valueCol.dicColumnIndex = 0 Then
MsgBox ("是否没有对应字典列检查,请联系管理员!")
Exit Function
End If
value = Sheets(valueSheetName).Cells(rowIndex, valueCol.columnIndex)
If value <> "" Then
isBeing = DoDicCheck(valueCol, rowIndex)
End If
End Function
''35 曾用名
Function checkCym(valueCol As TypeValueColum, rowIndex)
value = Sheets(valueSheetName).Cells(rowIndex, valueCol.columnIndex)
If value <> "" Then
isBeing = CheckValueLength(valueCol, rowIndex, 16, False)
End If
End Function
''36 身份证有效期
Function checkSfzyxq(valueCol As TypeValueColum, rowIndex)
value = Sheets(valueSheetName).Cells(rowIndex, valueCol.columnIndex)
If value <> "" Then
beLen = CheckValueLength(valueCol, rowIndex, 17, True)
If beLen Then
leftStr = Left(value, 8)
If CheckBeDate(leftStr) Then
Else
errorMsg = "第" & rowIndex & "行的数据项:" & valueCol.columnName & "不符合规范,请检查(例如:19900101-20090101)!"
writeLog (errorMsg)
Exit Function
End If
midStr = Mid(value, 9, 1)
If midStr <> "-" Then
errorMsg = "第" & rowIndex & "行的数据项:" & valueCol.columnName & "不符合规范,请检查(例如:19900101-20090101,其中'-'为英文横杠)!"
writeLog (errorMsg)
Exit Function
End If
rightStr = Right(value, 8)
If CheckBeDate(rightStr) Then
Else
errorMsg = "第" & rowIndex & "行的数据项:" & valueCol.columnName & "不符合规范,请检查(例如:19900101-20090101)!"
writeLog (errorMsg)
Exit Function
End If
compareNumber = compareDate(leftStr, rightStr)
If compareNumber <> -1 Then
errorMsg = "第" & rowIndex & "行的数据项:" & valueCol.columnName & "不合法,请检查(例如:19900101-20090101且后面的日期要大于前面的日期)!"
writeLog (errorMsg)
Exit Function
End If
Else
errorMsg = "第" & rowIndex & "行的数据项:" & valueCol.columnName & "不符合规范,请检查(例如:19900101-20090101)!"
writeLog (errorMsg)
End If
End If
End Function
''37 血型
Function checkXx(valueCol As TypeValueColum, rowIndex)
If valueCol.dicColumnIndex = 0 Then
MsgBox ("血型没有对应字典列检查,请联系管理员!")
Exit Function
…
|
|||
Open this report in the interactive analyzer, or submit your own file for analysis.