⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 excelcompare.frm

📁 实现两个excel文件的比较
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form frmMain 
   Caption         =   "Excel工作表差异性比较工具"
   ClientHeight    =   6555
   ClientLeft      =   2985
   ClientTop       =   2265
   ClientWidth     =   14115
   Icon            =   "ExcelCompare.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   6555
   ScaleWidth      =   14115
   Begin VB.CheckBox chkCase 
      Caption         =   "忽略错误"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   2640
      TabIndex        =   17
      Top             =   690
      Width           =   1575
   End
   Begin VB.CheckBox chkShow 
      Caption         =   "显示结果"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   1200
      TabIndex        =   16
      Top             =   690
      Width           =   1575
   End
   Begin VB.TextBox Text1 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Index           =   1
      Left            =   6840
      TabIndex        =   15
      Text            =   "Text1"
      Top             =   960
      Width           =   6615
   End
   Begin VB.TextBox Text1 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Index           =   0
      Left            =   1200
      TabIndex        =   14
      Text            =   "Text1"
      Top             =   960
      Width           =   5535
   End
   Begin VB.CommandButton cmdLoad 
      Caption         =   "加载到表格"
      Height          =   495
      Index           =   1
      Left            =   10920
      TabIndex        =   11
      Top             =   0
      Visible         =   0   'False
      Width           =   855
   End
   Begin VB.ComboBox cmbSheet 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   330
      Index           =   1
      Left            =   6960
      Style           =   2  'Dropdown List
      TabIndex        =   10
      Top             =   360
      Width           =   5535
   End
   Begin VB.TextBox txtFile 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Index           =   1
      Left            =   7080
      TabIndex        =   9
      Top             =   50
      Width           =   5655
   End
   Begin VB.CommandButton cmdOpen 
      Caption         =   "..."
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Index           =   1
      Left            =   12840
      TabIndex        =   8
      Top             =   10
      Width           =   375
   End
   Begin VB.OptionButton Option2 
      Caption         =   "公式"
      Height          =   255
      Left            =   120
      TabIndex        =   6
      Top             =   1000
      Width           =   1110
   End
   Begin VB.OptionButton Option1 
      Caption         =   "值"
      Height          =   255
      Left            =   120
      TabIndex        =   5
      Top             =   720
      Value           =   -1  'True
      Width           =   855
   End
   Begin VB.CommandButton cmdLoad 
      Caption         =   "加载到表格"
      Height          =   495
      Index           =   0
      Left            =   4800
      TabIndex        =   4
      Top             =   0
      Visible         =   0   'False
      Width           =   1065
   End
   Begin VB.ComboBox cmbSheet 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   330
      Index           =   0
      Left            =   960
      Style           =   2  'Dropdown List
      TabIndex        =   3
      Top             =   360
      Width           =   5535
   End
   Begin VB.CommandButton cmdOpen 
      Caption         =   "..."
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Index           =   0
      Left            =   6480
      TabIndex        =   1
      Top             =   10
      Width           =   375
   End
   Begin VB.TextBox txtFile 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Index           =   0
      Left            =   120
      TabIndex        =   0
      Top             =   50
      Width           =   6255
   End
   Begin MSFlexGridLib.MSFlexGrid Grid1 
      Height          =   5175
      Index           =   1
      Left            =   6840
      TabIndex        =   7
      Top             =   1320
      Width           =   6735
      _ExtentX        =   11880
      _ExtentY        =   9128
      _Version        =   393216
      FixedRows       =   0
      FixedCols       =   0
      ScrollTrack     =   -1  'True
      AllowUserResizing=   3
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin MSFlexGridLib.MSFlexGrid Grid1 
      Height          =   5175
      Index           =   0
      Left            =   0
      TabIndex        =   12
      Top             =   1320
      Width           =   6735
      _ExtentX        =   11880
      _ExtentY        =   9128
      _Version        =   393216
      FixedRows       =   0
      FixedCols       =   0
      ScrollTrack     =   -1  'True
      AllowUserResizing=   3
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.Label lblResults 
      Alignment       =   2  'Center
      Caption         =   "完毕..."
      Height          =   255
      Left            =   4200
      TabIndex        =   13
      Top             =   700
      Width           =   5055
   End
   Begin VB.Label Label2 
      Caption         =   "工作表"
      Height          =   195
      Left            =   120
      TabIndex        =   2
      Top             =   420
      Width           =   855
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Function GetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
Private Type OPENFILENAME
    lStructSize As Long
    hwndOwner As Long
    hInstance As Long
    lpstrFilter As String
    lpstrCustomFilter As String
    nMaxCustFilter As Long
    nFilterIndex As Long
    lpstrFile As String
    nMaxFile As Long
    lpstrFileTitle As String
    nMaxFileTitle As Long
    lpstrInitialDir As String
    lpstrTitle As String
    flags As Long
    nFileOffset As Integer
    nFileExtension As Integer
    lpstrDefExt As String
    lCustData As Long
    lpfnHook As Long
    lpTemplateName As String
End Type
Dim Col1st As Integer
Dim Confirm As Long
Dim eTitle$
Dim EMess$
Dim mError As Long
Dim Inits As Byte
Dim r As Integer
Dim c As Integer
Dim i As Integer
Dim Changing As Byte
Dim InitDir$
Dim lRet As Long

Private Sub chkCase_Click()
'if we changed our case selection, redo the compare
Compare
End Sub

Private Sub chkShow_Click()
'if our check box to show results is selected, then load the results form
If chkShow.Value = vbChecked Then
    frmResults.Show
Else
    Unload frmResults
End If
End Sub

Private Sub cmbSheet_Click(index As Integer)
'below keeps this event from firing again during this procedure
If Changing = 1 Then Exit Sub
'set the variable to indicate the change is in progress
Changing = 1
'load the sheet
cmdLoad_Click (index)
'if we have already loaded the form, then change the opposite combo to match
If Inits = 1 Then
    cmbSheet(1 - index).ListIndex = cmbSheet(index).ListIndex
    DoEvents
    cmdLoad_Click (1 - index)
    Compare
End If
DoEvents

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -