Attribute VB_Name = "模块2"
Sub dataprocess()
'
'dataprocessing
'
Dim newcase As Integer
Dim oldcase As Integer
Dim clscase As Integer
Dim yescase As Integer
Dim todcase As Integer
Dim Sht1 As Worksheet
Set Sht1 = Worksheets("today")
Dim Sht2 As Worksheet
Set Sht2 = Worksheets("yesteday")
yescase = 0
Do
yescase = yescase + 1
Loop Until Sht2.Cells(yescase + 2, 1) = ""
todcase = 0
Do
todcase = todcase + 1
Loop Until Sht1.Cells(todcase + 2, 1) = ""
oldcase = 0
i = 2
Do
j = 2
Do
If Sht1.Cells(i, 1) = Sht2.Cells(j, 1) Then
oldcase = oldcase + 1
'dataprocessing
Sht1.Cells(i, 8) = Sht2.Cells(j, 8)
Sht1.Cells(i, 11) = Sht2.Cells(j, 11)
Sht1.Cells(i, 1).Interior.ColorIndex = 39
'end_dataprocessing
Exit Do
End If
j = j + 1
Loop Until Sht2.Cells(j, 1) = ""
i = i + 1
Loop Until Sht1.Cells(i, 1) = ""
newcase = todcase - oldcase
clscase = yescase - oldcase
MsgBox "Dataprocessing Completed" & vbCrLf & _
"colse case num:" & clscase & vbCrLf & _
"old case num:" & oldcase & vbCrLf & _
"new case num:" & newcase
End Sub
本文来源:https://www.wddqw.com/doc/0839f6950a1c59eef8c75fbfc77da26924c5965b.html
正在阅读:
Excel VBA根据Sheet2中的表格数据处理Sheet1中的数据01-01
《风暴》普希金阅读答案01-01
工会财务管理制度01-01
搞笑的三句半大全01-01
关于向日葵的谜语及谜底答案01-01
毕业论文完整范文01-01
牛顿作文800字01-01
关于人间真情的作文600字4篇01-01