ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¶ñ¤J¼t¯Ê&µù¸Ñ

[µo°Ý] ¶ñ¤J¼t¯Ê&µù¸Ñ

¤j¤j¦n,
§Ú·Q±N ³Ì·s®w¦sB.xlsxªº ¼t¯Ê ¶ñ¤J ¤ë®w¦sªí.xlsx¤¤ ¨Ã¥[¥Hµù¸Ñ,½Ð°Ý¥H¤U»Ý¨D¸Ó¦p¦ó¼g?
µ{¦¡1
1) ¤ë®w¦sªí.xlsxªºsheet¥H¨C¤ëªº¤Ñ¼Æ©R¦W
2) ±N³Ì·s®w¦sB.xlsxªº­¸¤ñsheet BJ4:CB¸ê®Æ
3) ¶ñ¤J¤ë®w¦sªí.xlsx¤¤,¹ïÀ³ ³Ì·s®w¦sB.xlsx H1ªº¤é´Á
¨Ò¦p¡GH1 ¬°4/16,«h¹ïÀ³¤ë®w¦sªí.xlsxªºsheet 16
4) ³Ì·s®w¦sB.xlsxªº­¸¤ñBJ4:CBÀx¦s®æ<>"",«h¶ñ¤Jsheet 16 J4:Y
EX 1:¤ë®w¦sªí.xlsx sh16  J4­È¬°1266
¹ïÀ³ ³Ì·s®w¦sB.xlsx ªºBJ4Àx¦s®æ ­È¬°34
«hJ4=1266-34

EX 2:¤ë®w¦sªí.xlsx sh16  L7­È¬°198
¹ïÀ³ ³Ì·s®w¦sB.xlsx ªºBL7Àx¦s®æ ­È¬°""
«hL7Àx¦s®æ¤£§ïÅÜ....¨Ì¦¹Ãþ±À

µ{¦¡2
µ{¦¡1ªº¼t¯Ê¸ê®Æ¶ñ¤J«á
±N©Ò¦³¶ñ¤J¼t¯Ê­Èªº­È¦s®æ,´¡¤Jµù¸Ñ"¼t¯ÊXX"
EX 1:¤ë®w¦sªí.xlsx sh16  J4=1266-34
«hµù¸Ñ¬°  ¼t¯Ê34

¶ñ¤J¼t¯Ê.rar (842.49 KB)

¦^´_ 24# PJChen

ÁÂÁ¤j®a,
§Ú¤w§ä¨ì¤èªk¤F¡I

TOP

¥»©«³Ì«á¥Ñ PJChen ©ó 2022-4-17 20:47 ½s¿è

¦^´_ 22# ­ã´£³¡ªL
­ã¤j¦n,
³o­Óµ{¦¡§ï¤F¤@¦~¦h,³Ì«á­×§ï¤F±z¤§«e¼gªº¤@­Ó¥tµ{¦¡&¦X¨Ö³o­Ó,¥Î¨Ó¸ü¤J²£«~¹L¤¹ªº¼Æ¶q¤Î³Æµù,
­×§ï«á¼g¤J³Æµù¤è­±¦³¨ÇBug,¯à§_½Ð±z¼·¤¾À°¦£¬Ý¤U¡H§Ú§âµ{¦¡¼g¦b"­¸¤ñÁ`ªí.xls"¤¤

³Æµù§ì¨ú¤è¦¡
1..¨C­Ó®Æ¸¹,·íED:EE>0,«h¶ñ¤J¤½¥Î®w¦sªíªºAX:AY¬Û¹ïÀ³¦ì¸m
2..ED:EE>0ªº¦P¤@¦C,FZ:GC´N·|<0,
     ¦P¤@®Æ¸¹¾î¦V¨úFZ:GC,¨Ì§Ç¨ú
EX: C15®Æ¸¹,EE22=64
FZ22<0,¨úGE22ªº¤é´Á+GX22ªº¼Æ¶q...4/28*44
GA22=<0¨úGH22ªº¤é´Á+GY22ªº¼Æ¶q...4/29*20
GB22=<0¨úGK22ªº¤é´Á+GZ22ªº¼Æ¶q...4/30*336
¶ñ¤J¤½¥Î®w¦sªíªºAY22ªº³Æµù¤¤

3..°õ¦æ¶ñ¤J³Æµùªº°ÝÃD
GA:GC<0,·í³Æµù¶ñ¤JAX:AY®É,
GA:GC·|³Q­«½Æ§P§O,¾É­Pµù¸Ñ­«½Æ¶ñ¤JAX:AY¤¤

¦³°ÝÃDªº³¡¥÷,¦b¤½¥Î®w¦sªí¤¤,¤w¥Î¤£¦PÃC¦â¾ã¦CµÛ¦â,
½Ð°Ý­ã¤j,¦p¦óÅý³Æµù¤£­n³Q­«½Æ§ì¨ú?
¼g¤J¹L¤¹¼Æ¶q¤Î³Æµù.rar (204.82 KB)

TOP

¦^´_ 3# ­ã´£³¡ªL
­ã¤j¦n,

§Ú·Q¦b¸ü¤J¼t¯Êµ{¦¡¤¤,¥[¤J¸ü¤J¹º³æ¼Æ¦r,¸ê®Æ¨Ó·½¬°
­ì©l­q³æAP:BH
¼t¯Ê¼ÆBJ:CB
¹º³æ¼ÆCD:CV
1) ¤ë®w¦sªí¤ºªº­ì©l­q³æ¼Æ¦r¬O§@·~ªÌ,¦Û¦æ¶ñ¤J,¥u¦³¼Æ­È
2) ¦P¤@®Æ¸¹,­Y¦³¼t¯Ê¼Æ®É«h,Àx¦s®æ¤º=­ì©l­q³æ-¼t¯Ê¼Æ,
µù¸Ñ:
¼t¯Ê*XXX
3) ¦P¤@®Æ¸¹,­Y¦³¹º³æ¼Æ®É«h,Àx¦s®æ¤º=­ì©l­q³æ-¹º³æ¼Æ,
µù¸Ñ:
¹º³æ*XXX
4) ¦P¤@®Æ¸¹,­Y¦³¼t¯Ê¼Æ&¹º³æ¼Æ®É«h,Àx¦s®æ¤º=­ì©l­q³æ-¼t¯Ê¼Æ-¹º³æ¼Æ,
µù¸Ñ:
¼t¯Ê*XXX
¹º³æ*XXX

½Ð°Ýµ{¦¡¦p¦ó­×§ï¹F¨ì¤W­z»Ý¨D¡H
¼t¯Ê¶ñ¤J¤½¥Î®w¦sªí2.rar (875.74 KB)

TOP

¦^´_ 21# PJChen


ÁöµM»¡©ú¦h¦¸, ¦ýÁÙ¬O§Ë¤£À´, ¤@°ï¤å¦r¬Ý±o²´ªá,
µ{¦¡½X¤w¾¨¶q¤À¶}¼g§PÂ_, µ¹¤F¤èªk, ­Y³£µLªk²z¸Ñµ{¦¡½X¦Ó¦Û¦æ­×§ï,
³o¼Ë¤j®a³£¦£¤£§¹~~

TOP

¥»©«³Ì«á¥Ñ PJChen ©ó 2020-5-31 22:38 ½s¿è

¦^´_ 20# ­ã´£³¡ªL
  1.     If Val(Brr(i, 1)) < 0 Then
  2.        T(1) = "¤é¦L" & Format(Crr(i, 1), "m/d ") & "*" & Val(Crr(i, 2)) & "½c" & IIf(Val(Crr(i, 3)) > 0, "+" & Crr(i, 3), "")
  3.     End If
  4.     If Val(Brr(i, 2)) < 0 Then
  5.        T(2) = "¤é¦L" & Format(Crr(i, 4), "m/d ") & "*" & Val(Crr(i, 5)) & "½c" & IIf(Val(Crr(i, 6)) > 0, "+" & Crr(i, 6), "")
  6.     End If
  7.     TT(1) = T(1) & IIf(T(2) = "", "", vbCrLf & T(2))
  8.     '--------------------------------
  9.     If Val(Brr(i, 3)) < 0 Then
  10.        T(3) = "¤é¦L" & Format(Crr(i, 7), "m/d ") & "*" & Val(Crr(i, 8)) & "½c" & IIf(Val(Crr(i, 9)) > 0, "+" & Crr(i, 9), "")
  11.     End If
  12.     If Val(Brr(i, 4)) < 0 Then
  13.        T(4) = "¤é¦L" & Format(Crr(i, 10), "m/d ") & "*" & Val(Crr(i, 11)) & "½c" & IIf(Val(Crr(i, 12)) > 0, "+" & Crr(i, 12), "")
  14.     End If
½Æ»s¥N½X
'----------------------------------
­ã¤j¦n,
¥H¤Wµ{¦¡¹ïÀ³¨Ó·½¡G³Ì·s®w¦sB.xlsx GE:GPªº4²Õ½LÂI¸ê®Æ,·íVal(Brr) < 0,«h­n²£¥Íµù¸Ñ
¦ý²£¥Íªºµù¸Ñ´X¥G³£¤£¹ï,¥i§_§ï¬°§P§OED:EE>0²£¥Íµù¸Ñ,¤ñ¸û¦n§P§O¥Bª½Æ[¡I
¬O§_²£¥Íµù¸Ñ,³£¬ÝED:EE¬O§_>0
¥H¤U°t¦XÀÉ®×,¤ñ¸û¦n²z¸Ñ......
1) ¥H¦^¼t¼ÆED:EE§@§P§O, ¼Æ­È>0,¥Nªí¦³²£«~­n¦^¼t
2) ³o®ÉGA:GD¦Ü¤Ö¦³¤@­Ó­È<0,§ä<0¦bCKªº­þ¤@²Õ
3) ¦A¹ïÀ³GE:GPªº4²Õ½LÂI¸ê®Æ,¦¨¬°µù¸Ñªº¨Ó·½
4) 4²Õ½LÂI¸ê®Æ, ¤@©w¬O¥Ñ¤p¨ì¤j±Æ¦C,¤é´Á¤pªº±Æ¦b«e­±
5) ED:EE¥HEDÀu¥ý§P§O,ED³Ñ¤U¨Óªº¦^¼t¼Æ,´N¬OEEªº
6) EEÄæ: µL¦^¼t¼Æ®É,Àx¦s®æ¬°0 (¥­®É¦³¤½¦¡)
7) ED¬O¤â°Ê¶ñ¤J,µL¦^¼t¼Æ®ÉÀx¦s®æ¬°ªÅ¥Õ
8) EDªº­È>0 & ´«ºâ«á¥þ³¡¾ã¼Æ½c,­YEE>0,«hEE¦^¼t¹s¼Æ²~
9) EDªº­È>0 & ´«ºâ«á ¾ã½c+²~ ,³o®ÉEE¤@©w=0(µL¦^¼t)

ex1:
ED4=4416=4416/¤J¼Æ24=184½c (§äGA:GD¥þ³¡<0,«hµù¸ÑGE:GP 4²Õ¤é´Á)
EE4=5/¤J¼Æ24=¤£¨¬1½c=5(1²Õ¤é´Á)

ex2:³o­Ó§¹¥þµLªk²£¥Íµù¸Ñ
ED4=ªÅ¥Õ (µL¦^¼t=µLµù¸Ñ)
EE4=425/¤J¼Æ16=(2²Õ¤é´Á)
¦b¥ØªºÀÉAW²£¥Íµù¸Ñ
05/17*9
05/18*26½c

TOP

¦^´_ 19# PJChen


Á`¬Ý¤£À´»Ý¨D³W«h, ¦Û¦æ§ï§ï:
¸ü¤J¹L¤¹¤é¦Lv02.rar (179.24 KB)

TOP

¥»©«³Ì«á¥Ñ PJChen ©ó 2020-5-29 22:43 ½s¿è

¦^´_ 18# ­ã´£³¡ªL

ÁÂÁ­ã¤j¦Ê¦£¤¤À°¦£,§Ú¤]¤£ª¾¹D§ï¤£§ï±o¦¨! ¥i§_À°¦£¸Ñ»¡³o¬qªº·N«ä?

T1 = "": T2 = ""
        If Val(Brr(i, j * 2 + 1)) < 0 Then _
           T1 = Format(Crr(i, j * 6 + 1), "¤é¦Lm/d-") & Format(Crr(i, j * 6 + 2), "0½c") & Format(Crr(i, j * 6 + 3), "+0;;#;")
        If Val(Brr(i, j * 2 + 2)) < 0 Then _
           T2 = Format(Crr(i, j * 6 + 4), "¤é¦Lm/d-") & Format(Crr(i, j * 6 + 5), "0½c") & Format(Crr(i, j * 6 + 6), "+0;;#;")
        TT = Replace(Replace(Trim(T1 & " " & T2), " ", vbCrLf), "-", " *")
§Æ±æ§Ú¯à°÷¸Ñ»¡±o§ó²M·¡¨Ç,Àɮפ¤§Ú¼W¥[¤F¤@¨Ç½d¨Ò,§Æ±æ¦³À°§U¡I ¸ü¤J¹L¤¹¤é¦L_2.rar (772.3 KB)
ED:EE¦³¼Æ­È®É,¤~­n¶ñ¤Jµù¸Ñ
·íED:EE¦³¼Æ­È®É,«h§P§OGA:GD ¼Æ­È<0ªº¨º¤@²Õ,´N¬O¶ñ¤Jµù¸Ñªº¨Ó·½
µù¸Ñ¼g¤J¨Ó·½¥HEEÄ欰¥D,EDÄ欰¤â°ÊÄæ¦ì,·í¤u¼t¦³«ü¥Ü­n°h¦^®É,EDÄæ¤~·|¥X²{¼Æ­È,¥B¤j¦h¥H¾ã½c¬°³æ¦ì

TOP

¦^´_ 17# PJChen

Á`¬O¬Ý¤£À´³W«h, ºN¯Á°µ, ¦Û¦æ¥h­×§ï:
¸ü¤J¹L¤¹¤é¦Lv01.rar (190.13 KB)

TOP

¦^´_ 14# ­ã´£³¡ªL
­ã¤j¦n,
Àɮפw¥i¦Û°Ê¶}±Ò,¥t¤@·s»Ý¨D¡G¸ü¤J¹L¤¹¤é¦L,ÁÙ¦³¤@³¡¥÷µLªk¸Ñ¨M¡Gµù¸ÑµLªk¸ü¤J¤é´Á&¦U¦Ûªº¼Æ¶q
ªþ¤WÀÉ®×.... ¸ü¤J¹L¤¹¤é¦L.rar (766.13 KB)
ED4:EE4¦³¦^¼t¼Æ­È
±N³Ì·s®w¦sBªºED:EE¹L¤¹¼Æ¶q¸ü¤J¤ë®w¦sªíAV:AW
µù¸Ñ¨C­Ó¹L¤¹ªº¤é¦L¤Î¼Æ¶q
EX:1
¤ë®w¦sªíAV4Åã¥Üµù¸Ñ¬°:
¤é¦L5/5 *36½c
¤é¦L5/7 *140½c

¤ë®w¦sªíAW4Åã¥Üµù¸Ñ¬°:
¤é¦L5/5 *5

GA64<0
EX:2
¤ë®w¦sªíAV4Åã¥Üµù¸Ñ¬°:
¤é¦L 5/9 *3½c+3
  1. Sub ¸ü¤J¹L¤¹µù¸Ñ()
  2. Dim Sht As Worksheet, PH$, FN$, xB As Workbook, xS As Worksheet
  3. Dim xD, xR As Range, arr, R&, C&
  4. Application.ScreenUpdating = False
  5. Application.Calculation = xlManual
  6. Set Sht = Workbooks("³Ì·s®w¦sB.xlsx").Sheets("­¸¤ñ")  '¨Ó·½
  7. PH = "T:\¨p\½d¨Ò\VBA\¸ü¤J¹L¤¹¤é¦L\"
  8. FN = Dir(PH & "*¤ë®w¦sªí*.xlsx")
  9. Do While FN <> ""
  10. On Error Resume Next: Set xB = Workbooks(FN): On Error GoTo 0
  11. If xB Is Nothing Then Set xB = Workbooks.Open(PH & FN)
  12. FN = Dir
  13. Loop
  14. xB.Activate '¤½¥Î®w¦sªí
  15. On Error Resume Next: Set xS = xB.Sheets(Day(Sht.[H1]) & ""): On Error GoTo 0  '¤ñ¹ï¤é´Á,xS =¤½¥Îªº·í¤é¤u§@ªí
  16. If xS Is Nothing Then MsgBox "¡e¤é®w¦sªí¡f¤£¦s¦b! ": Exit Sub
  17. If xS.[AV2] = "***" Then MsgBox "¥»¤é¹L¤¹¤w¦©°£! ": Exit Sub
  18. '-------------------------------------
  19. Set xD = CreateObject("Scripting.Dictionary") '°O¿ý[¨Ó·½]Äæ¦ì¸m
  20. For Each xR In Range(xS.[B4], xS.[C65536].End(xlUp)) '¤½¥Î®w¦sªí,®Æ¸¹¬°¹ï¶H
  21.     If xR <> "" Then xD(xR & "") = xR.Row
  22. Next
  23. For Each xR In xS.[AV3:AW3] '°O¿ý¤½¥Î®w¦sªí[®Æ¸¹]¦C¦ì¸m
  24.     If xR = "" Or xR = "¦X­p" Then Exit For
  25.     xD(xR & "") = xR.Column
  26. Next
  27. '-------------------------------------
  28. R = Sht.[F65536].End(xlUp).Row  '¥H¨Ó·½[®Æ¸¹]¬°¸ê®Æ¦C¼Æ
  29. arr = Sht.Range("ED4:EE" & R)  '¨Ó·½¹L¤¹
  30. For i = 1 To UBound(arr)
  31.     R = xD(Sht.[E4].Cells(i, 1) & "") '¨ú±o¨Ó·½[®Æ¸¹]¦C¦ì¸m
  32.     If R = 0 Then GoTo i01
  33. For j = 1 To UBound(arr, 2)
  34.     C = xD(Sht.[ED3].Cells(1, j) & "") '¨ú±o[¨Ó·½]Äæ¦ì¸m
  35.     If C = 0 Then GoTo j01
  36.     If Val(arr(i, j)) = 0 Then GoTo j01
  37.     Set xR = xS.Cells(R, C)
  38. '    xR = Val(xR) - Arr(i, j) '¸ü¤J¹L¤¹,Åܦ¨­È
  39.     xR = arr(i, j)  '¸ü¤J¹L¤¹

  40.     xR.NoteText "PJ:" & vbCrLf & "¤é¦L *" & arr(i, j) 'µù¸Ñªº¤º®e,vbCrLf´«¦æ
  41.     With xR.Comment.Shape 'µù¸Ñªº®Ø¤j¤p
  42.         .Top = xR.Top
  43.         .Left = xR.Cells(1, 2).Left + 1
  44.         .Height = xR.Height + 24
  45.         .Width = 60
  46.     End With

  47. j01: Next j
  48. i01: Next i

  49. xS.[AV2] = "***" '¦©°£¹L¤¹¥H3¬Pµù°O(ÁקK­«ÂЦ©°£)
  50. Application.Calculation = xlCalculationAutomatic
  51. Application.GoTo xS.[J3]  '¤½¥Î®w¦sªí°_©l¦C¦ì¸m
  52. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ·O´d¨S¦³¼Ä¤H¡A´¼¼z¤£°_·Ð´o¡C
ªð¦^¦Cªí ¤W¤@¥DÃD