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

[µo°Ý] ½Ð°Ý¦p¦ó¤À§O¼¶¼gVBA¡A¨Ï¯S©w¤u§@ªíªº¯S©w­È¦X¨Ö¡A¦A§ì¯S©w­È¦^­ì©lÀÉ

¦^´_ 11# sax868
¬O­n§â"Updated Data"¹ïÀ³ªº­È¼g¤J¨C­Ó¤u§@ªíªº12¦C¥H¤U¤§AUÄæ¶Ü?
  1. Sub Ex()
  2. Dim Sh As Worksheet, Ar()
  3. Set d = CreateObject("Scripting.Dictionary") '³Ð«Ø¦r¨åª«¥óÀx¦s"Updated Data"¹ïÀ³ªº­È
  4. For Each Sh In Sheets
  5. With Sheets("Updated Data")
  6.    For Each a In .Range(.[A2], .Cells(.Rows.Count, 1).End(xlUp))
  7.      d(a & a.Offset(, 3) & a.Offset(, 12)) = a.Offset(, 49).Value '¥HA¡BD¡BM¬°¯Á¤Þ¦s¤JAXÄæ¦ìªº­È
  8.     Next
  9. End With
  10. With Sh
  11.   If UBound(Filter(Array("Currency", "DATA", "Updated Data"), .Name, True)) < 0 Then '°£¤F³o¨Ç¤u§@ªí¥H¥~°õ¦æ
  12.   ReDim Preserve Ar(57, x) 'ÂX¼W°}¦C
  13.   If IsEmpty(Ar(0, 0)) Then '¡A¦pªG°}¦CÁÙ¨S«Ø¥ß¥ý¼g¤J¼ÐÃD¦C
  14.      Ar(0, x) = .[B1].Value: Ar(1, x) = .[B2].Value: Ar(2, x) = .[D1].Value
  15.      s = 3
  16.      For Each a In .[A11:BB11].Value
  17.         Ar(s, x) = a
  18.         s = s + 1
  19.      Next
  20.      x = x + 1
  21.    End If
  22.    r = 12 '±q²Ä12¦C¥H¤U¶}©lŪ¤J¸ê®Æ¨ì°}¦C¤¤
  23.    Do Until .Cells(r, 1) = "" 'ª½¨ìAÄ欰ªÅ¥Õ¬°¤î
  24.       ReDim Preserve Ar(57, x)
  25.          Ar(0, x) = .[C1].Value: Ar(1, x) = .[C2].Value: Ar(2, x) = .[E1].Value
  26.          s = 3
  27.          For Each a In .Range(.Cells(r, "A"), .Cells(r, "BB")).Value '±NA:BBÄæ¦ìŪ¤J°}¦C
  28.             Ar(s, x) = a
  29.             s = s + 1
  30.          Next
  31.          .Cells(r, "AU") = d(Ar(0, x) & Ar(3, x) & Ar(12, x)) '±N¤u§@ªíªºAUÄæ¦ì¼g¤J¹ïÀ³ªºUpdated Data­È
  32.          x = x + 1: r = r + 1 '¤U¤@¦C
  33.    Loop
  34.   
  35.   End If
  36. End With
  37. Next
  38. With Sheets.Add(after:=Sheets(Sheets.Count)) '·s¼W¤u§@ªí©ó³Ì«á
  39. For i = 0 To UBound(Ar, 2)
  40.    For j = 0 To 56
  41.    .[A1].Offset(i, j) = Ar(j, i) '¤@¤@±N°}¦C¤¸¯À¼g¤JÀx¦s®æ
  42.    Next
  43. Next
  44. End With
  45. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

#VALUE!.zip (134.69 KB) ¦^´_ 9# Hsieh
¿Ë·Rªº¶W¯Åª©¥D¤Î¦U¦ì°ª¤â¤j¤j­Ì¤È¦w¡G

§Ú­è¥Î§Ú¨â¥ú¤T¸}¿ßªº¾Ç²ß¿ý¥¨¶°¡A§â§Ú·Q­nªº¤è¦¡ªí¹F¥X¨Ó¤F¡I(½Ð¸Ô¨£ªþÀÉ)
¸Õ·Q·Ð½Ð¤j¤j­ÌÀ°§Ú¬Ý¤@¤U¯à¤£¯àÁYµuVBA¥H´£°ªexcel ¹Bºâªº³t«×©O?
¥t¥~¡A¦]¬°§Ú¥u·|¿ý³æ¤@±i¤u§@ªí¡A½Ð°Ý¥i¤£¥i¥H³]©w­n¤@¦¸¶]©Ò¦³Àɮ׸̪º¤u§@ªí,°£¤F'Currency'¡B'DATA'¤Î'Updated Data'¤T±i¤u§@ªí¥H¥~©O?
*§Ú¬Ý¶W¯Åª©¥DHsieh¤j¼gªº³o­Ó·Q»¡´¡¤J§Y¥i¡A¥i¬O§Ú¤£·|¥Î...-_-lll
With Sh
  If UBound(Filter(Array("Currency", "DATA", "Updated Data"), .Name, True)) < 0 Then
  ReDim Preserve Ar(57, x)

¯u¤£¦n·N«ä¡A³Â·Ð¤j®a¤F!

§V¤O´å¥X¥®¥®¯Zªº
®z¤k¤l¯d

TOP

¥»©«³Ì«á¥Ñ sax868 ©ó 2012-5-8 12:10 ½s¿è

not ok.rar (55.18 KB) ¦^´_ 9# Hsieh

·PÁ¶W¯Åª©¥Dªº±Ï©R¤§®¦!! ¶W¯Å¦n¥Î!¤j·§µ¥2¤ÀÄÁµª®×¥þ¶]¥X¨Ó¡A³o¯uªº¤Ó¯«©_¤F!!
±µ¤U¨Óªº²Ä¤G­Ó°ÝÃDÁÙ±o¦A·Ð½Ð¶W¯Åª©¥DÀ°§Ú¸Ñ¨M...
§Ú¸ÕµÛ¼g¨ç¼ÆµM«á¥Î¿ý¥¨¶°ªº¤è¦¡¥i¬OµLªk¨C±i¤u§@ªí³£¤@°_§ï¡A¥H¤U¬O§Úªº»Ý¨D¡G
¨C¤@±i¤u§@ªí¸ÌFilter(Array("Currency", "DATA", "Updated Data")ªºAI12¦ÜAI300­È¬°:
­YC1='Updated Data'¸ÌªºA:AÄæ¥BA12='Updated Data'!¸ÌªºD: DÄæ¥BJ12='Updated Data'!¸ÌªºM:MÄæ¡A
«hAI12­È¬°'Updated Data'!AL:ALÄæ¸Ì¬Û¹ïÀ³ªº­È¡A¨Ã¥BA12¦ÜA300­È­Y¬°ªÅ®æ¡AAI12¦ÜAI300Ä欰ªÅ®æ¡A­Y¦³­È«h»Ý­pºâ¡F­YAI12¦ÜAI300Äæ¦ì­È¥X²{¹s«h·N±N¨ä­È³]¬°ªÅ®æ¡C

¨C¤@±i¤u§@ªí¸ÌFilter(Array("Currency", "DATA", "Updated Data")ªºAU12¦ÜAU300­È¬°:
­YC1='Updated Data'¸ÌªºA:AÄæ¥BA12='Updated Data'!¸ÌªºD: DÄæ¥BJ12='Updated Data'!¸ÌªºM:MÄæ¡A
«hAI12­È¬°'Updated Data'!AX:AXÄæ¸Ì¬Û¹ïÀ³ªº­È¡A¨Ã¥BA12¦ÜA300­È­Y¬°ªÅ®æ¡AAU12¦ÜAU300Ä欰ªÅ®æ¡A­Y¦³­È«h»Ý­pºâ¡F­YAU12¦ÜAU300Äæ¦ì­È¥X²{¹s«h·N±N¨ä­È³]¬°ªÅ®æ¡C

Á|¨Ò: ·Ð½Ð°Ñ¦Ò¤u§@ªí'1033600-2013' AI12Äæ¤ÎAU12Äæ§Úªº¨â¥ú¨ç¼Æ³o»ò¼g: =IF(A12="","",IF(AND(C1='Updated Data'!A2)+AND(A12='Updated Data'!D2)+AND(J12='Updated Data'!M2),'Updated Data'!AL2,""))   ¥i¬O³o©Û¦A¥t¤@±i¤u§@ªí'1006600-2013'´N¤£ÆF¥ú...:L

*­è­è§Ú¥ÎIndex+match¦n¹³¥i¥HÆF¥ú¤F!
¨Ò¤u§@ªí'1033600-2013' ¡G
AI12Äæ {=IF(A12="","",INDEX('Updated Data'!AL:AL,MATCH($C$1&$A12&$J12,'Updated Data'!A:A&'Updated Data'!D: D&'Updated Data'!M:M,0)))}
AU12Äæ {=IF(A25="","",INDEX('Updated Data'!AX:AX,MATCH($C$1&$A25&$J25,'Updated Data'!A:A&'Updated Data'!D: D&'Updated Data'!M:M,0)))}

¥i¬O¤£ª¾¬°Ô£¤@©w±o¦b³Ì«á«öCtrl+Shift+Enter¤~¯à¶]¥X¼Æ¾Ú,³o¨ç¼Æª½±µ½Æ»s¶KAI13:AI300®É¥þÅÜ'#VALUE!'...

¥H¤W¡A§Æ±æ¦³¸ÑÄÀ²M·¡...

«ô°U...½Ð¶W¯Åª©¥D©âªÅ¤Î¦U¦ì°ª¤â¤j¤j±Ï±Ï§Ú!!

¥®¥®¯Zªº®z¤k¤l¯d:$

TOP

¦^´_ 8# sax868
³oºØ°ÝÃD±`µo¥Í¦b°}¦C¤¸¯Àªº¦r¤¸¼Æ¶W¹L256­Ó¦r¤¸©Ò²£¥Í
¾É­PµLªk¥¿½T¾Þ§@°}¦CÂà¸m
§ï¦¨¤@¤@µ¹­È´N¥i¥H
  1.      x = x + 1
  2.    End If
  3.    r = 12
  4.    Do Until .Cells(r, 1) = ""
  5.       ReDim Preserve Ar(57, x)
  6.          Ar(0, x) = .[C1].Value: Ar(1, x) = .[C2].Value: Ar(2, x) = .[E1].Value
  7.          s = 3
  8.          For Each a In .Range(.Cells(r, "A"), .Cells(r, "BB")).Value
  9.             Ar(s, x) = a
  10.             s = s + 1
  11.          Next
  12.          x = x + 1: r = r + 1
  13.    Loop
  14.   End If
  15. End With
  16. Next
  17. With Sheets.Add(after:=Sheets(Sheets.Count))
  18. For i = 0 To UBound(Ar, 2)
  19.    For j = 0 To 56
  20.    .[A1].Offset(i, j) = Ar(j, i)
  21.    Next
  22. Next
  23. End With
  24. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

Desktop.zip (142.95 KB) ¦^´_ 7# Hsieh

ÁÂÁÂHsieh¤jªºÀ°¦£!¯uªº«Ü¤£¦n·N«ä¡A¦]¬°³o­ÓÀɮ׸̦³«Ü¦h§OªºÀɮתº³sµ²¸ò¨ä¥L«e¤H¼gªº¥¨¶°(¬Ý¤£À´...)ÁÙ¦³¤u§@ªí¤]·|ÀHMNo¼W¥[¦Ó¼W¥[¡A§Ú¦³¸ÕµÛ§â¤@¨Ç¤u§@ªí²¾°£µ²ªG¥X²{¸ê®Æ¤F¡A«á¨Ó§Ú§â´X­Ó¶]¤£¥X¸ê®Æªº¯d¦í¤@¨Ç¼Æ¾Ú¸ê®Æ²¾°£«á¥»¥´ºâ­n±Hµ¹±z°Ñ¦Ò¡Aµ²ªG¦A¶]¤@¦¸©~µM¥X²{¸ê®Æ¤F...

ÀH«Hªþ¤W³o­Ó¥X²{"°õ¦æ¶¥¬q¿ù»~'13' : «¬ºA¤£²Å¦X" ªº¼Æ¾Úµ¹±z¨Ñ°Ñ¦Ò¡C
·P¿E¤£ºÉ!

¥®¸X¶é¤j¯Zªº
®z¤k¤l¯d

TOP

¦^´_ 6# sax868


    ³o¤@¦æ¬O¼g¤J­Èªº¤èªk
¥X²{¿ù»~¥i¯à¬OX=0§a
§â¥X²{¿ù»~ªºÀɮפW¶Ç¬Ý¬Ý
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 5# sax868
©êºp!¤S¬O§Ú...
§Ú­è­è¦³¸ÕµÛ§â .[A1].Resize(x, 57) = Application.Transpose(Ar)  ³o¤@¦æ®³±¼.µ²ªG¶}¤F¤@­Ó·sªº¸ê®Æªí¦ý¤º®e¬OªÅ¥Õ...

TOP

¦^´_ 4# Hsieh

¯u¤£¦n·N«ä~­º¥ý¡A·PÁÂHsieh¤j¤jªºÀ°¦£! ¦b³oÀÉ®×¥i¥H¥Î¦ý¬O¨ì§ÚªºÀɮ׶]®É¥¦¥X²{ Run-time error '13': Type mismatch
½Ð°Ý³o¬O¬Æ»ò©O?

¦Û°Ê­°¯Å¦¨¥®¸X¶é¤j¯Zªº
®z¤k¤l¯d

TOP

¦^´_ 3# sax868
½T¹êµLªk¤F¸Ñ§Aªº»Ý¨D
°õ¦æ¥H¤Uµ{§Ç¡A¦Û°Ê¥Í¦¨·s¤u§@ªí¡A±o¨ìUpdated Dataªº¸ê®Æ
¦A¨Ó°Q½×§Aªº²Ä2­Ó°ÝÃD
  1. Sub Ex()
  2. Dim Sh As Worksheet, Ar()
  3. For Each Sh In Sheets
  4. With Sh
  5.   If UBound(Filter(Array("Currency", "DATA", "Updated Data"), .Name, True)) < 0 Then
  6.   ReDim Preserve Ar(57, x)
  7.   If IsEmpty(Ar(0, 0)) Then
  8.      Ar(0, x) = .[B1].Value: Ar(1, x) = .[B2].Value: Ar(2, x) = .[D1].Value
  9.      s = 3
  10.      For Each a In .[A11:BB11].Value
  11.         Ar(s, x) = a
  12.         s = s + 1
  13.      Next
  14.      x = x + 1
  15.    End If
  16.    r = 12
  17.    Do Until .Cells(r, 1) = ""
  18.       ReDim Preserve Ar(57, x)
  19.          Ar(0, x) = .[C1].Value: Ar(1, x) = .[C2].Value: Ar(2, x) = .[E1].Value
  20.          s = 3
  21.          For Each a In .Range(.Cells(r, "A"), .Cells(r, "BB")).Value
  22.             Ar(s, x) = a
  23.             s = s + 1
  24.          Next
  25.          x = x + 1: r = r + 1
  26.    Loop
  27.   
  28.   End If
  29. End With
  30. Next
  31. With Sheets.Add(after:=Sheets(Sheets.Count))
  32. .[A1].Resize(x, 57) = Application.Transpose(Ar)
  33. End With
  34. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 2# register313

·PÁÂregister313 ¤j¤jªº°T³t¦^ÂÐ!
¥i¬O¶]¤£¥X¸ê®Æ­C~½Ð°Ý³o¸òª©¥»¦³Ãö¶Ü? §Ú¬O¥Îoffice2010, W7.
¥¦Åã¥Ü¤@­Óµøµ¡¼g: Can't execute code in break mode
§Ú´N¦Û¤v¥[¶}¤@­Ó¤u§@ªíÁä¤JUpdated Data µM«á¦A¶]¤@¹M µ²ªG¤S¥X²{: Run-time error '9': Subscript out of range
«ô°U±Ï§Ú...

TOP

        ÀR«ä¦Û¦b : ¤£­nÀH¤ß©Ò±ý¡A­nÀH¤ß±Ð¨|¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD