- ©«¤l
- 913
- ¥DÃD
- 150
- ºëµØ
- 0
- ¿n¤À
- 1089
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- office 2019
- ¾\ŪÅv
- 50
- ©Ê§O
- ¤k
- µù¥U®É¶¡
- 2011-8-28
- ³Ì«áµn¿ý
- 2023-7-19
|
¦^´_ 14# ã´£³¡ªL
ã¤j,
¨C¤ë·|ÅܰʪºÀɦW,«ü©wÀx¦s®æ§@¥Î¤£¤j,§ÚÁÙ¬O·Q¥Î*¤ë®w¦sªí*ªº¶}±Ò¤è¦¡,
²¤×§ïµ{¦¡,¥i¥H¶}±ÒÀÉ®×,¦ýµLªk¸ü¤J¼t¯Ê,¥i§_À°¦£¬Ý¤U°ÝÃD©Ò¦b?- Sub ¸ü¤J¼t¯Êµù¸Ñ()
- Dim Sht As Worksheet, PH$, FN$, xB As Workbook, xS As Worksheet
- Dim xD, xR As Range, Arr, R&, C&
- Application.ScreenUpdating = False
- Application.Calculation = xlManual
- Set Sht = Workbooks("³Ì·s®w¦sB.xlsx").Sheets("¸¤ñ") '¨Ó·½
- PH = "T:\½d¨Ò\"
- FN = Dir(PH & "*¤ë®w¦sªí*.xlsx")
- Do While FN <> ""
- On Error Resume Next: Set xB = Workbooks(FN): On Error GoTo 0
- If xB Is Nothing Then Set xB = Workbooks.Open(PH & FN) '¤½¥Î®w¦sªí
- FN = Dir
- Loop
- xB.Activate '¤½¥Î®w¦sªí
- On Error Resume Next: Set xS = xB.Sheets(Day(Sht.[H1]) & ""): On Error GoTo 0 '¤ñ¹ï¤é´Á
- If xS Is Nothing Then MsgBox "¡e¤é®w¦sªí¡f¤£¦s¦b! ": Exit Sub
- If xS.[J2] = "***" Then MsgBox "¥»¤é®w¦s¤w¦©°£! ": Exit Sub
- '-------------------------------------
- Set xD = CreateObject("Scripting.Dictionary") '°O¿ý[¨Ó·½]Äæ¦ì¸m
- For Each xR In Range(xS.[E4], xS.[E65536].End(xlUp)) '¤½¥Î®w¦sªí
- If xR <> "" Then xD(xR & "") = xR.Row
- Next
- For Each xR In xS.[J3:AZ3] '°O¿ý¤½¥Î®w¦sªí[°Ó«~¦WºÙ]¦C¦ì¸m
- If xR = "" Or xR = "¦Xp" Then Exit For
- xD(xR & "") = xR.Column
- Next
- '-------------------------------------
- R = Sht.[H65536].End(xlUp).Row '¥H¨Ó·½[°Ó«~¦WºÙ]¬°¸ê®Æ¦C¼Æ
- Arr = Sht.Range("BJ4:CB" & R) '¨Ó·½¼t¯Ê½d³ò
- For i = 1 To UBound(Arr)
- R = xD(Sht.[H4].Cells(i, 1) & "") '¨ú±o¨Ó·½[°Ó«~¦WºÙ]¦C¦ì¸m
- If R = 0 Then GoTo i01
- For j = 1 To UBound(Arr, 2)
- C = xD(Sht.[BJ3].Cells(1, j) & "") '¨ú±o[¨Ó·½]Äæ¦ì¸m
- If C = 0 Then GoTo j01
- If Val(Arr(i, j)) = 0 Then GoTo j01
- Set xR = xS.Cells(R, C)
- ' xR = Val(xR) - Arr(i, j) '¸ü¤J¼t¯Ê,Åܦ¨È
- xR = "=" & Val(xR) & "-" & Arr(i, j) '¸ü¤J¼t¯Ê
- xR.NoteText "PJ:" & Chr(10) & "¼t¯Ê*" & Arr(i, j) 'µù¸Ñªº¤º®e,Chr(10)´«¦æ
- With xR.Comment.Shape 'µù¸Ñªº®Ø¤j¤p
- .Top = xR.Top
- .Left = xR.Cells(1, 2).Left + 1
- .Height = xR.Height + 12
- .Width = 50
- ' .TextFrame.Characters.Font.Size = 9 '¦Ûq¦rÅé¤j¤p,¦b®a¥i¥H¹B§@,¦ý¤½¥q¤£¦æ
- '.Shadow.Visible = False '¨ú®ø³±¼v
- End With
- j01: Next j
- i01: Next i
- xS.[J2] = "***" '¦©°£®w¦s¥H3¬Pµù°O(ÁקK«ÂЦ©°£)
- Application.Calculation = xlCalculationAutomatic
- Application.GoTo xS.[J3] '¤½¥Î®w¦sªí°_©l¦C¦ì¸m
- End Sub
½Æ»s¥N½X |
|