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

¦p¦ó¥i¥HÅý¤£¬O"JPM"¤£Åã¥Ü¥X¨Ó¡A¤]¤£·|¯d¤@¦æªÅ®æ¡H

¦^´_ 10# Hsieh


    Sub sample()

Dim LastRec As Integer
Dim j As Integer
Dim i As Integer
Dim l As Integer
Dim data() As Range
l = 1
fs = "C:\Documents and Settings\USER\®à­±\HK ETA update.xlsx"          ³o¥y¥X²{error °õ¦æ¶¥¬q¿ù»~'13'«¬ºA¤£²Å¦X¡I
Set wb = Workbooks.Open(fs)

Workbooks("outstanding payments").Worksheets("2012").Range("A1").Select ³o
ActiveCell.End(xlDown).Select
     LastRec = ActiveCell.Row
     


For j = 1 To LastRec

i = Application.Match(Worksheets("2012").Cells(j, 1), wb.Sheets("­»´ä&®ü¨¾³æ").Range("A:A"), 0)


If Worksheets("2012").Cells(i, 4).Value <> wb.Sheets("­»´ä&®ü¨¾³æ").Cells(i, 12).Value Then

Worksheets("2012").Cells(i, 4).Value = wb.Sheets("­»´ä&®ü¨¾³æ").Cells(i, 2).Value
Worksheets("2012").Cells(i, 4).Interior.Color = RGB(255, 200, 255)
End If

Next j

wb.Close 0

End Sub

TOP

¦^´_ 11# 198188
  1. Sub nn()
  2. Dim Ay(), Rng As Range, m$, A As Range, r&, Ar
  3. With Sheets("Sheet1") '§ï¦¨¥¿½T¤u§@ªí¦WºÙ
  4. If Application.CountIf(.Range("B:B"), "JPM") > 0 Then '§PÂ_BÄæ¬O§_¦³JPM
  5. .Range("B:B").Replace "JPM", "=1/0", xlWhole '±NJPM¥H¤½¦¡¨ú¥N
  6. Set Rng = .Range("B:B").SpecialCells(xlCellTypeFormulas, 16) '±N¤½¦¡¬°¿ù»~­ÈªºÀx¦s®æ³]¬°ÅܼÆ
  7. Rng.Value = "JPM" '±N¤½¦¡Á٭즨JPM
  8. For Each A In Rng
  9. r = A.Row
  10. m = .Cells(r, "U") & "¡B" & .Cells(r, "V") & "¡B" & .Cells(r, "W")
  11. Ar = Array(.Cells(r, "S").Value, .Cells(r, "T").Value, .Cells(r, "C").Value, .Cells(r, "AA").Value, .Cells(r, "D").Value, .Cells(r, "AB").Value, _
  12. .Cells(r, "AC").Value, .Cells(r, "AD").Value, .Cells(r, "AE").Value, .Cells(r, "AF").Value, .Cells(r, "F").Value, m, .Cells(r, "X").Value, .Cells(r, "Y").Value, .Cells(r, "Z").Value)
  13. ReDim Preserve Ay(s)
  14. Ay(s) = Ar
  15. s = s + 1
  16. Next
  17. Sheets("JPM").UsedRange.Offset(1).Clear '±NJPM¤u§@ªí¤º®e²MªÅ
  18. If s > 0 Then Sheets("JPM").[A2].Resize(s, UBound(Ar) + 1) = Application.Transpose(Application.Transpose(Ay)) '±N°}¦C¼g¨ìJPM¤u§@ªí
  19. End If
  20. End With
  21. End Sub
½Æ»s¥N½X
Match¨ç¼Æ¦pªG§ä¤£¨ì²Å¦X¸ê®Æ´N·|¥X¿ù
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 10# Hsieh


    ¥¼©R¦W.rar (118.82 KB)
ÁÙ¬O¦³¿ù»~

TOP

¦^´_ 10# Hsieh

µ²ªG.rar (198.35 KB)

¥i¥H±NJPM ¸ê®Æ½Æ»s¹L¥h¤F¡AÁÂÁ¡I
¦ý¬O¦³¨S¦³¤èªk§ïÅÜ¥¦­Ìªº¦ì¸m¡A¦]¬°§Ú¤£¬O­n¥þ³¡·h¹L¥h¡A©M§Ú·Q¥¦­Ì¦bA:F¶¶§Ç§Û¹L¥h¡C
   
DATE        TRACKING NO        SO NO        MM        BUYER        PLANT        BOXES        CONTAINER NO        ORIGIN        ETD        ETA        DOCS LIST        REMARK        US ARRANGE PAYMENT ON        HK PICK UP ON

TOP

¥»©«³Ì«á¥Ñ Hsieh ©ó 2012-11-13 15:13 ½s¿è

¦^´_ 9# 198188
  1. Sub nn()
  2. With Sheets("Sheet1") '§ï¦¨¥¿½T¤u§@ªí¦WºÙ
  3. If Application.CountIf(.Range("B:B"), "JPM") > 0 Then '§PÂ_BÄæ¬O§_¦³JPM
  4. .Range("B:B").Replace "JPM", "=1/0", xlWhole '±NJPM¥H¤½¦¡¨ú¥N
  5. Set Rng = .Range("B:B").SpecialCells(xlCellTypeFormulas, 16) '±N¤½¦¡¬°¿ù»~­ÈªºÀx¦s®æ³]¬°ÅܼÆ
  6. Rng.Value = "JPM" '±N¤½¦¡Á٭즨JPM
  7. Sheets("JPM").UsedRange.Offset(1).Clear '±NJPM¤u§@ªí¤º®e²MªÅ
  8. Rng.EntireRow.Copy Sheets("JPM").[A2] '±NBÄ欰JPMªº¦C½Æ»s¶K¨ìJPM¤u§@ªí
  9. End If
  10. End With
  11. End Sub
½Æ»s¥N½X
°ÝÃD¤G
¶}±ÒÀÉ®×
fs = "C:\user\destop\outstanding payment.xlsx"
Set wb = Workbooks.Open(fs)
For j=1 To ....
i = Application.Match(Sheet1.Cells(1, j), wb.Sheets("Sheet2").[A:A], 0)
...
...
...
Next
wb.Close 0
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 8# Hsieh


result.rar (486.07 KB)

ÁÙ¬O¨S¦³Åã¥Ü¥X¨Ó. JPM WORKSHEETªÅ¥Õ¤@¤ù~
¥t¥~·Q°Ý
Sub sample()

Dim LastRec As Integer
Dim j As Integer
Dim i As Integer
Dim l As Integer
Dim data() As Range
l = 1

Worksheets("Sheet1").Range("A1").Select
ActiveCell.End(xlDown).Select
     LastRec = ActiveCell.Row
     

For j = 1 To LastRec

i = Application.Match(Sheet1.Cells(1, j), "C:\user\destop\[outstanding payment]Sheet2'!.Range("A:A"), 0) §Ú·QŪ¨ú®à­±¥t¥~¤@­Óexcelªº¸ê®Æ¡A³o¥y¬O¤£¬O¦³°ÝÃD¡H

If Sheet1.Cells(i, 2).Value <> Sheet2.Cells(i, 2).Value Then

Sheet1.Cells(i, 2).Value = Sheet2.Cells(i, 2).Value
Sheet1.Cells(i, 2).Interior.Color = RGB(255, 200, 255)
End If

Next j

End Sub

TOP

¦^´_ 6# 198188
  1. Sub nn()
  2. With ¤u§@ªí1
  3. If Application.CountIf(.Range("B:B"), "JPM") > 0 Then '§PÂ_BÄæ¬O§_¦³JPM
  4. .Range("B:B").Replace "JPM", "=1/0", xlWhole '±NJPM¥H¤½¦¡¨ú¥N
  5. Set Rng = .Range("B:B").SpecialCells(xlCellTypeFormulas, 16) '±N¤½¦¡¬°¿ù»~­ÈªºÀx¦s®æ³]¬°ÅܼÆ
  6. Rng.Value = "JPM" '±N¤½¦¡Á٭즨JPM
  7. Sheets("JPM").UsedRange.Offset(1).Clear '±NJPM¤u§@ªí¤º®e²MªÅ
  8. Rng.EntireRow.Copy Sheets("JPM").[A2] '±NBÄ欰JPMªº¦C½Æ»s¶K¨ìJPM¤u§@ªí
  9. End If
  10. End With
  11. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 5# c_c_lai


    ³o­Óµ{¦¡¨S¦³¤Ï¬M¡A¬O§_ÁÙ¤í¯Ê¤@¨Ç¸ê®Æ¡H

TOP

¦^´_ 4# Hsieh


    04.Set Rng = .Range("B:B").SpecialCells(xlCellTypeFormulas, 16) ¥X²{error, ±N§ÚDATA BASEªº JPMÂন1/0,¦ý¦bjpm worksheet¤º´N¨S¦³copy ¸ê®Æ¹L¥h¡I

¥t¥~JPM  worksheetªº¸ê®Æ¬O¶¶§Ç±NDATA BASEªº JPM¸ê®Æ§Û¹L¨Ó¡A¦ýÂ\¦ì¬O¤£¤@¼Ë

DATA BASE (SHEET1)
Äæ¼Æ¥ÑA :Z
ITEM NO / STATE / SO / BUYER / AGENT / ETA /RECEIVE DATE/ RECEIVE TRACKING NO/ RECEIVE OBL/RECEIVE OHC/RECEIVE OTHER DOCS/RECEIVE REMARK/SEND DATE/SEND TRACKING NO/ SEND OBL/SEND OHC/SEND OTHER DOCS/SEND REMARK/ JPM DATE/JPM REF NO/JPM OBL/JPM OHC/ JPM OTHER DOCS/JPM REMARK/JPM US ARRANGE PAYMENT ON/JPM HK PICK UP ON

JPM WORKSHEET (JPM)¥uÅã¥Ü³o¨Ç¸ê®Æ
Äæ¼Æ¥ÑA : G
JPM DATE / JPM REF NO / SO/JPM DOCS LIST(JPM OBL, JPM OHC, JPM OTHER DOCS ¦X¨Ö¡^/JPM REMARK/JPM US ARRANGE PAYMENT ON/JPM HK PICK UP ON

TOP

¦^´_ 1# 198188
¤£ª¾¹D³o¬O§_¬O§Aªº»Ý¨D¡H
  1. Sub Test()
  2.     Sheets("JPM").Visible = False
  3. End Sub

  4. Sub Test2()
  5.     Sheets("JPM").Visible = True
  6. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¬°¤H³B¥@­n¤p¤ß²Ó¤ß¡A¦ý¤£­n¡u¤p¤ß²´¡v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD