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

¤£¦P¤u§@ªí§ä¹ï¤ñ¸ê®Æ¡A¤u§@ªí¦WºÙ¤£©T©w

¤£¦P¤u§@ªí§ä¹ï¤ñ¸ê®Æ¡A¤u§@ªí¦WºÙ¤£©T©w

¥»©«³Ì«á¥Ñ 198188 ©ó 2024-2-23 17:34 ½s¿è

¤u§@ªí¡§A" ³o­Ó¬O©T©wªº¤u§@ªí¦WºÙ
¨ä¥L¤u§@ªíªº¦WºÙ¤£©T©w¡A¦Ó¥B¤£©T©w¤u§@ªí¼Æ¶q¡A¦ý¬O·|±Æ¦b¤u§@ªí¡§A"¤§«á
·Q­nªº¥\¯à¬O
®Ú¾Ú¤u§@ªí "A" ùتºÄæ C - H¡A´M§ä¨ä¥L©Ò¦³¤u§@ªíªºÄæ B - G ¬O§_¦³§¹¥þ¤@­Pªº¼Æ¾Ú¡A«ö·Ó¤U­±ªº¹ï¤ñ´M§ä¸ê®Æ¡C¦pªG§ä¨ì¥þ³¡¤@­Pªº¡A¦bÄæ I ª`©ú "Y", ¦pªG¨S¦³¬Û¦P¸ê®Æªº¡A¦bÄæ I ª`©ú "N"
¤u§@ªí"A" Äæ C   ¹ï¤ñ  ¨ä¥L¤u§@ªí ÄæB
¤u§@ªí"A" Äæ D   ¹ï¤ñ  ¨ä¥L¤u§@ªí ÄæC
¤u§@ªí"A" Äæ E   ¹ï¤ñ   ¨ä¥L¤u§@ªí ÄæD
¤u§@ªí"A" Äæ F   ¹ï¤ñ   ¨ä¥L¤u§@ªí ÄæE
¤u§@ªí"A" Äæ G  ¹ï¤ñ   ¨ä¥L¤u§@ªí ÄæF
¤u§@ªí"A" Äæ H  ¹ï¤ñ   ¨ä¥L¤u§@ªí ÄæG

TEST1.rar (314.25 KB)

¦^´_ 15# Andy2483
Andy ®v¥S,
©ú¥Õ¤F,ÁÂÁ§A¨C¤@¦¸³£«Ü¸Ô²Óªº¸ÑÄÀ,
ÁÂÁÂ

TOP

¦^´_ 14# mdr0465

¦b¤°»ò®É¶¡¤~·|¨M©w¨Ï¥Î"Scripting Dictionary" (¦r¨å)
1.³B²z­«½Æ.¤£­«½Æ¸ê®Æ
2.ÅÜ°ÊÅܼƤӦh®É,¥H¦r¨åKEY·íÅܼÆ
3.°O¾Ð¦C¸¹®É
4.¬°¤F½m²ß¦r¨å®É,¥ô¦ó±¡ªp³£·Q­n¥Î¦r¨å
5.¨ä¥L
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

¦^´_ 13# Andy2483
Andy ®v¥S,

ÁÂÁ§A±x¤ß´£¨Ñ¦³¥Îªº±Ð§÷¥O§Ú­T¶ë¹y¶}, ±q¦Ó§ó²`¤J²z¸Ñ³o½s½Xªº¹B¥Î,
¦ý¾Ç§Ì¦³¤@­ÓºÃ°Ý¦A·Q¦VAndy ½Ð±Ð, §Ú©ú¥Õ¦P¤@­Ó°ÝÃD¥i¥H¥Î¤£¦P¤è¦¡¥h½s¼g¦P¼Ë³£¥i¥H°µ¥X¦P¼Ëªºµ²ªG
¦ý½Ð°ÝAndy¾Ç¥S¡A¥H§A­Ó¤Hªº¨£¸Ñ¡A§A·|¦b¤°»ò®É¶¡¤~·|¨M©w¨Ï¥Î"Scripting Dictionary" (¦r¨å)
¤°»ò®É¶¡´N¤£¥Î¦Ó¥Î¨ä¥L¤è¦¡¥h½s¼gµ{¦¡©O¡H

ÁÂÁÂ

TOP

¥»©«³Ì«á¥Ñ Andy2483 ©ó 2024-3-6 13:57 ½s¿è

¦^´_ 12# mdr0465

¯Á¤Þ¸¹±q 0¶}©l:


Option Explicit
Sub Àx¦s®æ»P°}¦C_2() 'ª`·N! ¥ý¶}¤@­Ó·s¤u§@ªí¦A°õ¦æ,¥H§K»~§R­«­n¸ê®Æ
Dim Arr(3, 5), i%, j%, N%
ActiveSheet.UsedRange.ClearContents
For i = 1 To UBound(Arr)
   Arr(i, 0) = "¼ÐÃDÄ涵 " & i
   For j = 1 To UBound(Arr, 2)
      If i = 1 Then Arr(0, j) = "¼ÐÃD¦C¶µ " & j
      N = N + 1
      Arr(i, j) = N
   Next
Next
Arr(0, 0) = "Äæ \ ¦C"
[A1].Resize(UBound(Arr) + 1, UBound(Arr, 2) + 1) = Arr
[A1].Resize(UBound(Arr) + 1, UBound(Arr, 2) + 1).Select
MsgBox "¥þ³¡Arr°}¦C­È±qÀx¦s®æ[A1]¶}©l¶K¤J­È"
End Sub
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

¦^´_ 11# Andy2483

Andy ®v¥S,
ÁÂÁ§A­@¤ß«ü¾É©M´£¨Ñ¦³¥Î±Ð§÷µ¹§Ú¤F¸Ñ·í¤¤ªº¹B§@,
²{¦b`«á½ú¤F¸Ñ·í¤¤ªº¹B§@¤F,¸U¤À·PÁ§A:handshake

TOP

¦^´_ 9# mdr0465

¶i¤@¨B¹B¥Î,½Ð¸Õ°õ¦æ¥H¤U¥N½X:


Option Explicit
Sub Àx¦s®æ»P°}¦C_1() 'ª`·N! ¥ý¶}¤@­Ó·s¤u§@ªí¦A°õ¦æ,¥H§K»~§R­«­n¸ê®Æ
Dim Arr(1 To 3, 1 To 5), Brr, Crr, Drr, i%, j%, A, N%
ActiveSheet.UsedRange.ClearContents
For i = 1 To UBound(Arr)
   For j = 1 To UBound(Arr, 2)
      N = N + 1
      Arr(i, j) = N
   Next
Next
[A1].Resize(UBound(Arr), UBound(Arr, 2)) = Arr
[A1].Resize(UBound(Arr), UBound(Arr, 2)).Select
MsgBox "¥þ³¡Arr°}¦C­È±qÀx¦s®æ[A1]¶}©l¶K¤J­È"

Brr = Range([F1], [A65536].End(xlUp))
For i = 1 To UBound(Brr)
   For j = 2 To UBound(Brr, 2)
      Brr(i, 1) = Brr(i, 1) + Brr(i, j)
   Next
Next
[A6].Resize(UBound(Brr)) = Brr
[A6].Resize(UBound(Brr)).Select
MsgBox "¦bBrr°}¦C²Ä1Äæ¸Ì¥[Á`·í¦C­È«á,±qÀx¦s®æ[A6]¶}©l¶K¤JBrr³¡¤À°}¦C­È" & vbLf & _
       "1+2+3+4+5=15" & vbLf & "6+7+8+9+10=40" & vbLf & "11+12+13+14+15=65"
End Sub
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

¦^´_ 9# mdr0465

ÁÂÁ½׾Â,ÁÂÁ«e½ú¤@°_¾Ç²ß
½Ð¸Õ°õ¦æ¥H¤U¥N½X:


Option Explicit
Sub Àx¦s®æ»P°}¦C() 'ª`·N! ¥ý¶}¤@­Ó·s¤u§@ªí¦A°õ¦æ,¥H§K»~§R­«­n¸ê®Æ
Dim Arr(1 To 3, 1 To 5), Brr, Crr, Drr, i%, j%, A, N%
ActiveSheet.UsedRange.ClearContents
For i = 1 To UBound(Arr)
   For j = 1 To UBound(Arr, 2)
      N = N + 1
      Arr(i, j) = N
   Next
Next
[A1].Resize(UBound(Arr), UBound(Arr, 2)) = Arr
[A1].Resize(UBound(Arr), UBound(Arr, 2)).Select
MsgBox "¥þ³¡Arr°}¦C­È±qÀx¦s®æ[A1]¶}©l¶K¤J­È"

[A6].Resize(1, UBound(Arr, 2)) = Arr
[A6].Resize(1, UBound(Arr, 2)).Select
MsgBox "²Ä1¦CArr°}¦C­È±qÀx¦s®æ[A6]¶}©l¶K¤J­È"

[A8].Resize(UBound(Arr), 1) = Arr
[A8].Resize(UBound(Arr), 1).Select
MsgBox "²Ä1ÄæArr°}¦C­È±qÀx¦s®æ[A8]¶}©l¶K¤J­È"

[A12].Resize(2, 2) = Arr
[A12].Resize(2, 2).Select
MsgBox "³Ì¥ª¤W¨¤2Äæ2¦CArr°}¦C­È±qÀx¦s®æ[A12]¶}©l¶K¤J­È"

[A15].Resize(4, 6) = Arr
[A15].Resize(4, 6).Select
MsgBox "Arr°}¦C­È¤ñ©Ò«ü©wÀx¦s®æ½d³ò¤p±¡ªp,±qÀx¦s®æ[A15]¶}©l¶K¤J­È¶W¥X³¡¤À·|¥X²{¿ù»~­È"
End Sub
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

¥»©«³Ì«á¥Ñ mdr0465 ©ó 2024-3-5 23:26 ½s¿è

¦^´_ 3# Andy2483

  Andy ¾Ç¥S,§A¦n
¤S¬O§Ú³o¤@¦W·MÄøªº¾Ç§Ì

Sub TEST()
Dim Arr, Brr, Crr, V, Z, Q, i&, j%, R&, c%, Y&, X%, T$, T1$, T2$, T3$
Dim xR As Range, Ra As Range, Sh As Worksheet, xBook As Workbook
Set Z = CreateObject("Scripting.Dictionary")
Brr = Range([Data!E2], [Data!A65536].End(3))
For i = 1 To UBound(Brr)
   T = Trim(Brr(i, 1)) & "/" & Val(Brr(i, 2)) & "/" & Val(Brr(i, 3))
   If Z.EXISTS(T) Then
      MsgBox T & "­«½Æ":  Exit Sub
      Else
      Z(T) = Val(Brr(i, 5))
      Z(T & "/n") = 1
   End If
Next
Arr = Range([Invoice!H12], [Invoice!C65536].End(3))
ReDim Crr(1 To UBound(Arr), 1 To 6)
For i = 1 To UBound(Arr)
   If Trim(Arr(i, 1)) = "" Then GoTo i01
   T = Trim(Arr(i, 1)) & "/" & Val(Arr(i, 2)) & "/" & Val(Arr(i, 3))
   Z(T & "/n") = Z(T & "/n") + 1
   If Z(T & "/n") > 2 Then MsgBox T & "­«½Æ":  Exit Sub Else V = Z(T)
   If V = "" Then GoTo i01
   Crr(i, 1) = V
   Crr(i, 2) = V - Val(Arr(i, 4))
   Crr(i, 3) = Application.Round(Val(Arr(i, 2)) * Val(Arr(i, 3)) / 10 ^ 6, 3)
   Crr(i, 4) = Crr(i, 3) - Val(Arr(i, 5))
   Crr(i, 5) = Application.Round(Crr(i, 3) * Val(Arr(i, 4)), 3)
   Crr(i, 6) = Crr(i, 5) - Val(Arr(i, 6))
i01: Next
[Invoice!J12].Resize(UBound(Crr), 6) = Crr <<  ¦bºô¤W§ä¨ì¦n¦h³oÃþ«¬ªº½s½X, resize(ubound(Crr).6) §Ú³£²z¸Ñ, ¦ý=Crr§Ú©l²×³£¤£©ú¥Õ³o­Ó­ì²z, ³Â·Ð§A¥i¤£¥i¥H«üÂI¾Ç§Ì°g¬z, «ç¼ËÀ³¥Î³oºØ¤èªkªº½s½X©O , ÁÂÁÂ
End Sub

TOP

¦^´_ 7# Andy2483


    ­ì¨ÓÁôÂäF¡A§Ú¨S¯d·N©O¡AÁÂÁ¸ѵª¡C

TOP

        ÀR«ä¦Û¦b : ¤H¨ÆªºÁ}Ãø»PµZ¿i¡A´N¬O¤@ºØ¦ÒÅç¡C
ªð¦^¦Cªí ¤W¤@¥DÃD