📄 frmcheckxls.frm
字号:
VERSION 5.00
Begin VB.Form frmCheckXls
BorderStyle = 1 'Fixed Single
Caption = "选择对应比较列"
ClientHeight = 5790
ClientLeft = 45
ClientTop = 435
ClientWidth = 4800
BeginProperty Font
Name = "Verdana"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "frmCheckXls.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 5790
ScaleWidth = 4800
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
Height = 30
Left = 90
TabIndex = 12
Top = 4080
Width = 4605
End
Begin VB.CheckBox ckGetTWO
Caption = "生成两个结果集(默认生成1个合并结果集)"
Height = 225
Left = 120
TabIndex = 11
Top = 4500
Width = 4635
End
Begin VB.CheckBox ckSAME
Caption = "输出相同/重复的数据行"
Height = 255
Left = 120
TabIndex = 10
Top = 4170
Width = 4635
End
Begin VB.CommandButton cmdSUB2
Caption = "-"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 2700
TabIndex = 8
Top = 3720
Width = 285
End
Begin VB.ListBox lst2
BeginProperty Font
Name = "Verdana"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 3300
Left = 2430
Style = 1 'Checkbox
TabIndex = 7
Top = 330
Width = 2235
End
Begin VB.CommandButton cmdHelp
Caption = "Help me ?"
Height = 345
Left = 120
TabIndex = 6
Top = 5370
Width = 2295
End
Begin VB.CommandButton cmdSUB
Caption = "-"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 390
TabIndex = 5
Top = 3720
Width = 285
End
Begin VB.CommandButton cmdADD
Caption = "+"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 120
TabIndex = 4
Top = 3720
Width = 285
End
Begin VB.CommandButton cmdCancel
Caption = "取消"
Height = 345
Left = 3570
TabIndex = 3
Top = 5370
Width = 1155
End
Begin VB.CommandButton cmdOk
Caption = "确定"
Height = 345
Left = 2430
TabIndex = 2
Top = 5370
Width = 1155
End
Begin VB.ListBox lst
BeginProperty Font
Name = "Verdana"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 3300
Left = 120
Style = 1 'Checkbox
TabIndex = 1
Top = 330
Width = 2235
End
Begin VB.CommandButton cmdADD2
Caption = "+"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 2430
TabIndex = 9
Top = 3720
Width = 285
End
Begin VB.Label Label3
Caption = "! 未选列会在结果集中自动显示出来;"
ForeColor = &H000000FF&
Height = 225
Left = 150
TabIndex = 14
Top = 5040
Width = 4605
End
Begin VB.Label Label2
Caption = "! 所选比较列必须一一对应次序, 不能有交叉次序情况;"
ForeColor = &H000000FF&
Height = 225
Left = 150
TabIndex = 13
Top = 4770
Width = 4605
End
Begin VB.Label Label1
Caption = "源列表:"
Height = 195
Left = 150
TabIndex = 0
Top = 90
Width = 4545
End
End
Attribute VB_Name = "frmCheckXls"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public strColIndex As String
Public strColName As String
Public strColName2 As String
Public ickSAME As Integer
Public ickGetTWO As Integer
Private Sub cmdAdd_Click()
Call lstSelected(True, lst)
End Sub
Private Sub cmdADD2_Click()
Call lstSelected(True, lst2)
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdHelp_Click()
Exit Sub
MsgBox "the first xlsfile compare colname must same as the second xlsfile colname!" & vbCrLf & vbCrLf _
& "you can rename other right colname in any xlsfile. Example: " & vbCrLf & vbCrLf _
& "xls1: PartNo / Snno / Qty / Location / rtStat / RmaOUT / RmaDt.." & vbCrLf & vbCrLf _
& "xls2: Location / PartNo / Qty / rtNo / rtPartNo / Snno.." & vbCrLf & vbCrLf _
& "now PartNo + Snno + Qty + Location can compare !!!!" & vbCrLf & vbCrLf _
& "pls give the first line for full value !" & vbCrLf & vbCrLf _
& "365171 0.7 0.8 27 18 21 1.7", vbInformation, InfoMsg
End Sub
Private Sub cmdOk_Click()
strColName = ""
strColName2 = ""
Dim i As Integer
ickSAME = ckSAME.Value
ickGetTWO = ckGetTWO.Value
For i = 0 To lst.ListCount - 1
If Trim(lst.List(i)) = "" Then
MsgBox "第 " & i + 1 & " 列为空, 请修正文件增加一个列名再试一次!", vbExclamation, ErrMsg
Exit Sub
End If
If lst.Selected(i) Then
'strColIndex = strColIndex & i & ","
strColName = strColName & "[" & lst.List(i) & "],"
End If
Next
If strColName <> "" Then
strColName = Mid(strColName, 1, Len(strColName) - 1)
Else
MsgBox "pls check any colname !", vbExclamation, ErrMsg
lst.SetFocus
Exit Sub
End If
For i = 0 To lst2.ListCount - 1
If Trim(lst2.List(i)) = "" Then
MsgBox "第 " & i + 1 & " 列为空, 请修正文件增加一个列名再试一次!", vbExclamation, ErrMsg
Exit Sub
End If
If lst2.Selected(i) Then
strColName2 = strColName2 & "[" & lst2.List(i) & "],"
End If
Next
If strColName2 <> "" Then
strColName2 = Mid(strColName2, 1, Len(strColName2) - 1)
Dim aa, bb
aa = Split(strColName, ",")
bb = Split(strColName2, ",")
If UBound(aa) <> UBound(bb) Then
MsgBox "Left Selected <> Right Selected, pls select again.", vbExclamation, ErrMsg
lst.SetFocus
Else
Unload Me
End If
Else
MsgBox "pls check any colname !", vbExclamation, ErrMsg
lst2.SetFocus
End If
End Sub
Private Sub cmdSUB_Click()
Call lstSelected(False, lst)
End Sub
Private Sub cmdSUB2_Click()
Call lstSelected(False, lst2)
End Sub
Private Sub Form_Load()
strColIndex = ""
strColName = ""
strColName2 = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -