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

½Ð°Ý¥i§_°µ¨ì¦Û°Ê¦©´î¸ê®Æ

½Ð°Ý¥i§_°µ¨ì¦Û°Ê¦©´î¸ê®Æ

Book1.rar (8.27 KB)
½Ð°Ý¥i§_°µ¨ì¦Û°Ê¦©´î¡C
Åã¥ÜSO NOÁÙ¦³¨º¨Ç¤å¥ó¨S¦³±H¥X¡B
µL½×¤U­±¤T­ÓÄæ¿é¤Jªº¦r¬O§_¬Û¦P¡A¥u­nÀx¦s®æ¦³¸ê®Æ´N¥Nªí¬Û¦P
IÄæ=OÄæ¡AµL½×Àx¦s®æªº¸ê®Æ¬O§_¬Û¦P¡A¥u­n³o¨âÄæ¦P®É¦³¸ê®Æ¡A´N¥Nªí¨S¦³OBL
JÄæ=PÄæ¡AµL½×Àx¦s®æªº¸ê®Æ¬O§_¬Û¦P¡A¥u­n³o¨âÄæ¦P®É¦³¸ê®Æ¡A´N¥Nªí¨S¦³OHC
KÄæ=QÄæ¡AµL½×Àx¦s®æªº¸ê®Æ¬O§_¬Û¦P¡A¥u­n³o¨âÄæ¦P®É¦³¸ê®Æ¡A´N¥Nªí¨S¦³CO
sheet1¬O¸ê®Æ®w¡AON HAND¬O­nªº®ÄªG

¦^´_ 10# Hsieh

°ª¤H¥i§_À°§Ú¬Ý¬Ý¤U­±linkªºµ{¦¡¿ù¦b­þ¸Ì¡H
    http://forum.twbts.com/viewthrea ... amp;page=4#pid47882

TOP

¦^´_ 10# Hsieh


   ¥i¥H¤F¡AÁÂÁÂ~
¦ý¬O ¦pªGSO NO¨S¦³¦¬¥ó¡A¦Ó¥ý±H¥ó¡A¤]Åã¥Ü¥X¨Ó¤F¡C¤£¹L³oºØ±¡ªp°£«D¤H¬°¿ù»~¡A§_«h¤]¤£·|¥¼¦³¥ó´N¥i¥H±H¥ó

TOP

¦^´_ 9# 198188

À³¸Ó¬O§Aªº§@¥Î¤¤¤u§@ªí¨Ã«DSheet1
¨º´N¤½¦¡¤º°Ñ·Ó¥[¤W¤u§@ªí
  1. Sub ex()
  2. Set d = CreateObject("Scripting.Dictionary")
  3. ay = Array("OBL", "OHC", "CO")
  4. With Sheets("Sheet1")
  5. Set Rng = .Range(.[C2], .Cells(.Rows.Count, 3).End(xlUp))
  6. For Each a In Rng
  7.   If IsEmpty(d(a.Value)) Then
  8.   For i = 9 To 11
  9.   Set rng1 = .Cells(2, i).Resize(Rng.Rows.Count, 1)
  10.   Set rng2 = .Cells(2, i + 6).Resize(Rng.Rows.Count, 1)
  11.      x = Evaluate("SumProduct((" & Rng.Address(, , , 1) & "=" & a & ")*(" & rng1.Address(, , , 1) & "<>""""))")  '°Ñ·Ó¦ì§}¥]§t¥~³¡°Ñ·Ó
  12.      y = Evaluate("SumProduct((" & Rng.Address(, , , 1) & "=" & a & ")*(" & rng2.Address(, , , 1) & "<>""""))")  '°Ñ·Ó¦ì§}¥]§t¥~³¡°Ñ·Ó
  13.      If x = 0 Xor y = 0 Then mystr = IIf(mystr = "", ay(i - 9), mystr & "," & ay(i - 9))
  14.   Next
  15.   If mystr <> "" Then d(a.Value) = Array(a.Value, a.Offset(, 1).Value, a.Offset(, 2).Value, a.Offset(, 3).Value, mystr) Else d.Remove a.Value
  16.   mystr = ""
  17.   End If
  18. Next
  19. End With
  20. With Sheets("ON HAND")
  21. .UsedRange.Offset(1).ClearContents
  22. If d.Count > 0 Then .[A2].Resize(d.Count, 5) = Application.Transpose(Application.Transpose(d.items))
  23. End With
  24. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 8# Hsieh


   
.[A2].Resize(d.Count, 5) = Application.Transpose(Application.Transpose(d.items))
¥X²{error RUN-TIME ERROR'13':  TYPE MISMATCH

TOP

  1. Sub ex()
  2. Set d = CreateObject("Scripting.Dictionary")
  3. ay = Array("OBL", "OHC", "CO")
  4. With Sheets("Sheet1")
  5. Set rng = .Range(.[C2], .Cells(.Rows.Count, 3).End(xlUp))
  6. For Each a In rng
  7.   If IsEmpty(d(a.Value)) Then
  8.   For i = 9 To 11
  9.   Set rng1 = .Cells(2, i).Resize(rng.Rows.Count, 1)
  10.   Set rng2 = .Cells(2, i + 6).Resize(rng.Rows.Count, 1)
  11.      x = Evaluate("SumProduct((" & rng.Address & "=" & a & ")*(" & rng1.Address & "<>""""))")
  12.      y = Evaluate("SumProduct((" & rng.Address & "=" & a & ")*(" & rng2.Address & "<>""""))")
  13.      If x = 0 Xor y = 0 Then mystr = IIf(mystr = "", ay(i - 9), mystr & "," & ay(i - 9))
  14.   Next
  15.   If mystr <> "" Then d(a.Value) = Array(a.Value, a.Offset(, 1).Value, a.Offset(, 2).Value, a.Offset(, 3).Value, mystr) Else d.Remove a.Value
  16.   mystr = ""
  17.   End If
  18. Next
  19. End With
  20. With Sheets("ON HAND")
  21. .UsedRange.Offset(1).ClearContents
  22. .[A2].Resize(d.Count, 5) = Application.Transpose(Application.Transpose(d.items))
  23. End With
  24. End Sub
½Æ»s¥N½X
¦^´_ 7# 198188
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 6# GBKEE
Book1.rar (8.68 KB)
SO NO 111111 ¤À§O¦¬¨ìOBL*3, OHC, CO ¡F ¤Î¤À§O±H¥XOHC
©Ò¥H
SO NO        BUYER        AGENT        ETA                            DOCS LIST
111111        A        AA        23-Oct-12        OBL,CO

SO NO 222222 ¤À§O¦¬¨ìCO*2, OBL, OHC ¡F ¤Î¤À§O±H¥XOHC, CO
©Ò¥H
SO NO        BUYER        AGENT        ETA                            DOCS LIST
222222        B        BB        15-Nov-12        OBL

SO NO 333333 ¤À§O¦¬¨ì OBL, OHC, CO ¡F ¤Î¤À§O±H¥X CO, OHC, OBL
©Ò¥H
SO NO        BUYER        AGENT        ETA                            DOCS LIST

SO NO 444444 ¤À§O¦¬¨ì OBL, OHC, CO ¡F ¤Î¤À§O±H¥X OHC, CO
©Ò¥H
SO NO        BUYER        AGENT        ETA                            DOCS LIST   
444444        D        DD        25-Dec-12        OBL

IÄæ©MOÄ椣ºÞÀx¦s®æ¤º®e¬O¤°»ò¡A¥u­nÀx¦s®æ¤º¦³¸ê®Æ¡A¹q¸£´N¦Û°ÊÀq»{¥¦¬OOBL
JÄæ©MPÄ椣ºÞÀx¦s®æ¤º®e¬O¤°»ò¡A¥u­nÀx¦s®æ¤º¦³¸ê®Æ¡A¹q¸£´N¦Û°ÊÀq»{¥¦¬OOHC
KÄæ©MQÄ椣ºÞÀx¦s®æ¤º®e¬O¤°»ò¡A¥u­nÀx¦s®æ¤º¦³¸ê®Æ¡A¹q¸£´N¦Û°ÊÀq»{¥¦¬OCO

TOP

¦^´_ 5# 198188
1#ªº»¡©ú¹ï»PªþÀÉ[ON HAND]ªº½d¨Ò±µ¤£¤W°Ú!!½Ð¦b»¡©ú¬Ý¬Ý.

TOP

¦^´_ 3# GBKEE

Book1.rar (8.62 KB)


¨£¨ì¤F¡A¥i¯à¤£¤p¤ß¥´¦h¤F¡A²{ªþ¤W§ó¥¿ªºªþ¥ó¡C

TOP

¦^´_ 3# GBKEE


    ¨S¦³¨âÄæSO,§Ú­è¤~¥´¶}³£¨S¦³¡H¥u¦³item no and SO

§A¬O¤£¬O°ÝSO¤ºªº¸ê®Æ¬Û¦P¡H

TOP

        ÀR«ä¦Û¦b : ¤@¥y·Å·xªº¸Ü¡A´N¹³©¹§O¤H¨­¤WÅx­»¤ô¡A¦Û¤v·|ªg¨ì¨â¤Tºw¡C
ªð¦^¦Cªí ¤W¤@¥DÃD