- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 1# tmde987
¹ï©ó§Aªº»¡©ú,¤£«Ü¤F¸Ñ,¸Õ¬Ý¬Ý¬O³o¤è¦V¶Ü?- Sub CommandButton4_Click()
- With Workbooks.Open("C:\Documents and Settings\901755\®à±\±¶®|(§tmanual)\2.xls")
- .Sheets(1).Range("B:C,O:O").Copy Workbooks("compareab_v3.xls").Sheets("¸ê®ÆA").Range("A1")
- .Sheets(1).Range("L:L").Copy Workbooks("compareab_v3.xls").Sheets("¸ê®ÆA").Range("D1")
- .Close
- End With
- End Sub
½Æ»s¥N½X- Sub CommandButton5_Click()
- 'Workbooks.Open Filename:="C:\Documents and Settings\901755\®à±\±¶®|(§tmanual)\3.xls"
- With WorkbooksOpen("C:\Documents and Settings\901755\®à±\±¶®|(§tmanual)\3.xls")
- .Sheets(1).Range("B:C,O:O").Copy Workbooks("compareab_v3.xls").Sheets("¸ê®ÆB").Range("A1")
- .Sheets(1).Range("L:L").Copy Workbooks("compareab_v3.xls").Sheets("¸ê®ÆB").Range("D1")
- .Close
- End With
- End Sub
½Æ»s¥N½X- Option Explicit
- Sub Ex_¸ê®Æ¤ñ¹ï()
- Dim D As Object, Rng As Range, K As Variant, Msg As Boolean, xi As Integer
- Set D = CreateObject("SCRIPTING.DICTIONARY")
- Sheets("¸ê®ÆA").Cells.Font.ColorIndex = 0
- Sheets("¸ê®ÆB").Cells.Font.ColorIndex = 0
- Sheets("¸ê®ÆA¯Ê¤Öªº").Cells.Clear
- Sheets("¸ê®ÆB¯Ê¤Öªº").Cells.Clear
- Set Rng = Sheets("¸ê®ÆA").[A1]
- Do While Rng <> ""
- Set D(Rng & Rng(1, 2)) = Rng.Resize(, 4)
- Set Rng = Rng.Offset(1)
- Loop
- Set Rng = Sheets("¸ê®ÆB").[A2]
- Do While Rng <> ""
- Msg = False
- If D(Rng & Rng(1, 2)).Cells(3) <> Rng(1, 3) Then
- Msg = True
- D(Rng & Rng(1, 2)).Cells(3).Font.Color = vbRed
- Rng(1, 3).Font.Color = vbRed
- End If
- If D(Rng & Rng(1, 2)).Cells(4) <> Rng(1, 4) Then
- Msg = True
- D(Rng & Rng(1, 2)).Cells(4).Font.Color = vbRed
- Rng(1, 4).Font.Color = vbRed
- End If
- If Msg = True Then
- xi = xi + 1
- Sheets("¸ê®ÆA¯Ê¤Öªº").Cells(xi, "a").Resize(1, 4) = D(Rng & Rng(1, 2)).Value
- Sheets("¸ê®ÆB¯Ê¤Öªº").Cells(xi, "a").Resize(1, 4) = Rng.Resize(1, 4).Value
- Else
- D.Remove (Rng & Rng(1, 2))
- End If
- Set Rng = Rng.Offset(1)
- Loop
- With Sheets("¸ê®ÆA»PB³£¦³ªº")
- If D.Count > 0 Then
- .Cells.Clear
- xi = 1
- For Each K In D.KEYS
- .Cells(xi, "a").Resize(1, 4) = D(K).Value
- xi = xi + 1
- Next
- End If
- End With
- End Sub
½Æ»s¥N½X |
|