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

[¤À¨É] ¤j½L¨C¤ë¨C¤Ñ¾ú¥v¦¨¥æ¶q»Pª÷ÃB¤U¸ü

¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-10-19 12:58 ½s¿è

¦^´_ 29# usana642
¦ý¬O«ö¶s¤£¨£¤F?




27# ¥[¤Jµ{¦¡½X
  1. With .Range("b2", .[b2].End(xlDown))
  2.             .Offset(, -1) = "=rc4 +rc8 + rc9"
  3.             .Columns(5).Replace "-", ""
  4.             .Columns(7) = "=IF(rc[-3]=""Call"",1,0)"    'R1C1ªí¥Üªk : ¤u§@ªí¤Wß}¤J¤½¦¡
  5.             .Columns(8) = "=IF(rc[-6]=r1c9,1,8)"
  6.             .Columns(9) = "=IF(rc[-2]=1,rc[-3],0)"
  7.             .Columns(10) = "=IF(rc[-3]=0,rc[-4],0)"
  8.             .Columns(11) = "=if(rc[-1]=0,rc[-6]*rc[-5],"""")"
  9.             .Columns(12) = "=if(rc[-2]<>0,rc[-7]*rc[-6],"""")"
  10.              With .Cells(.Rows.Count + 1, 1) '.Rows.Count + 1 ½d³ò¤º¸ê®ÆÁ`¦C¼Æ+1
  11.                 .Cells(1, 0) = "¤p­p"
  12.                 .Cells(1, 6) = Application.Sum(.Parent.Columns(6))
  13.                 .Cells(1, 9) = Application.Sum(.Parent.Columns(9))
  14.                 .Cells(1, 10) = Application.Sum(.Parent.Columns(10))
  15.                 .Cells(1, 11) = Application.Sum(.Parent.Columns(11))
  16.                 .Cells(1, 12) = Application.Sum(.Parent.Columns(12))
  17.             End With
  18.         End With
½Æ»s¥N½X

TOP

¦^´_ 32# usana642
¤£¦n·N«ä¨S¸Ô²ÓÀˬd,§ó¥¿¦p¤U
  1. Option Explicit
  2. Private Sub §ó·s()
  3.     Dim Rng As Range
  4.     With ActiveSheet
  5.         .Cells.Clear
  6.         With .QueryTables.Add("URL;http://www.taifex.com.tw/chinese/3/3_2_2.asp", ActiveSheet.[A1])
  7.             .WebFormatting = xlWebFormattingNone
  8.             .Refresh BackgroundQuery:=False
  9.             ActiveSheet.Names(.Name).Delete
  10.         End With
  11.         .Range("E:G,I:L,N:Q").Delete                                    '§R°£¦h¾lªºÄæ
  12.         .Range("1:6,8:8").Delete                                        '§R°£¦h¾lªº¦C
  13.         .Range("B1").End(xlDown).Offset(1).Resize(2).EntireRow.Delete   '§R°£¦h¾lªº¦C
  14.         .Range("A:A").Insert                                            '´¡¤J¤@Äæ
  15.         .[B1].Resize(, 12) = Array("«´¬ù", "¤ë¥÷", "¼i¬ù»ù", "¶R½æÅv", "¦¨¥æ»ù", "¥¼¥­­Ü¶q", "CALL", "=C2", "call-oi", "put-oi", "call-oi$", "put-oi$")
  16.         '**  "=C2" ¥i­×§ï¬° ¥¿½Tªº°Ñ·Ó  ***
  17.         With .Range("b2", .[b2].End(xlDown))
  18.             .Offset(, -1) = "=rc4 +rc8 + rc9"
  19.             .Columns(5).Replace "-", ""
  20.             .Columns(7) = "=IF(rc[-3]=""Call"",1,0)"    'R1C1ªí¥Üªk : ¤u§@ªí¤Wß}¤J¤½¦¡
  21.             .Columns(8) = "=IF(rc[-6]=r1c9,1,8)"
  22.             .Columns(9) = "=IF(rc[-2]=1,rc[-3],0)"
  23.             .Columns(10) = "=IF(rc[-3]=0,rc[-4],0)"
  24.             .Columns(11) = "=if(rc[-1]=0,rc[-6]*rc[-5],"""")"
  25.             .Columns(12) = "=if(rc[-2]<>0,rc[-7]*rc[-6],"""")"
  26.         End With
  27.         .UsedRange.Value = .UsedRange.Value             '®ø°£¤½¦¡
  28.         .Columns.AutoFit
  29.         Set Rng = .Range("b2", .[b2].End(xlDown))
  30.         With Rng
  31.             .Offset(, -1) = "=rc4 +rc8 + rc9"
  32.             .Columns(5).Replace "-", ""
  33.             .Columns(7) = "=IF(rc[-3]=""Call"",1,0)"    'R1C1ªí¥Üªk : ¤u§@ªí¤Wß}¤J¤½¦¡
  34.             .Columns(8) = "=IF(rc[-6]=r1c9,1,8)"
  35.             .Columns(9) = "=IF(rc[-2]=1,rc[-3],0)"
  36.             .Columns(10) = "=IF(rc[-3]=0,rc[-4],0)"
  37.             .Columns(11) = "=if(rc[-1]=0,rc[-6]*rc[-5],"""")"
  38.             .Columns(12) = "=if(rc[-2]<>0,rc[-7]*rc[-6],"""")"
  39.              With .Cells(.Rows.Count + 1, 1) '.Rows.Count + 1 ½d³ò¤º¸ê®ÆÁ`¦C¼Æ+1
  40.                 .Cells(1, 0) = "¤p­p"
  41.                 .Cells(1, 6) = Application.Sum(Rng.Columns(6))
  42.                 .Cells(1, 9) = Application.Sum(Rng.Columns(9))
  43.                 .Cells(1, 10) = Application.Sum(Rng.Columns(10))
  44.                 .Cells(1, 11) = Application.Sum(Rng.Columns(11))
  45.                 .Cells(1, 12) = Application.Sum(Rng.Columns(12))
  46.             End With
  47.         End With
  48.     End With
  49. End Sub
½Æ»s¥N½X

TOP

¦^´_ 35# c_c_lai
«ö¥kÁä

   

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-10-20 08:50 ½s¿è

¦^´_ 37# c_c_lai
·|¬O¦b [¤j¤p¤Î¤º®e] ¤¤¶Ü?
FormulaR1C1 ÄÝ©Ê   ¶Ç¦^©Î³]©wª«¥óªº¤½¦¡¡A¥Î¥¨¶°»y¨¥ªº R1C1 ¼Ë¦¡²Å¸¹ªí¥Ü¡CRange ª«¥ó¬°Åª/¼g Variant¡ASeries ª«¥ó¬°Åª/¼g String¡C
°õ¦æ«á ¦p¹Ï ¤Ä¿ï R1C1  «Kª¾

  1. Option Explicit
  2. Sub Ex()
  3.     Dim i
  4.     For i = 1 To 5
  5.         [c5].Cells(1, i) = "=r" & i & "c" & i
  6.         [c5].Cells(2, i) = "=r[" & i & "]c[" & i & "]"
  7.         [c5].Cells(3, i) = "=r[-" & i & "]c[-" & i & "]"
  8.     Next
  9. End Sub
½Æ»s¥N½X

TOP

¦^´_ 44# usana642
  1. Option Explicit
  2. Sub Àx¦s¤p­pµ²ªG()
  3.     Dim Rng As Range
  4.     Set Rng = Sheets("­pºâ").Range("G1").End(xlDown)                 'G1©¹¤U³Ì«á¦³¸ê®ÆªºÀx¦s®æ
  5.     With Sheets("¬ö¿ý").Cells(Rows.Count, "A").End(xlUp).Cells(2, 1)
  6.          'Cells(Rows.Count, "A").End(xlUp):AÄæ³Ì«á¦C©¹¤W¦³¸ê®ÆªºÀx¦s®æ.Cells(2, 1) :²Ä2¦C ,²Ä1Äæ
  7.           .Value = Date
  8.           .Cells(1, 2) = Rng
  9.           .Cells(1, 3).Resize(1, 4) = Rng.Cells(1, 4).Resize(1, 4).Value
  10.     End With
  11. End Sub
½Æ»s¥N½X

TOP

¦^´_ 47# usana642
¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Sub Àx¦s¤p­pµ²ªG()
  3.     Dim Rng(1 To 4) As Range, AR(1 To 6), xi As Integer, e As Variant
  4.     With Sheets("­pºâ")
  5.         Set Rng(1) = .Range("G1").End(xlDown)                 'G1©¹¤U³Ì«á¦³¸ê®ÆªºÀx¦s®æ
  6.         Set Rng(2) = .Range("E2", .[E2].End(xlDown))          '¶R½æÅv
  7.     End With
  8.     For Each e In Array("Call", "Put")
  9.         Rng(2).Replace e, "=usana642"                          '¤½¦¡¤£¦s¦b ¶Ç¦^¿ù»~­È
  10.         With Rng(2).SpecialCells(xlCellTypeFormulas, xlErrors) '¦³¿ù»~ªºÀx¦s®æ
  11.             With .Offset(, 2)                                  '¥k²¾2Äæ
  12.                 xi = IIf(e = "Call", 0, 1)
  13.                 Set Rng(3) = .Find(Application.Max(.Cells))    '´M§ä³Ì¤j­È
  14.                 AR(1 + xi) = Rng(3).Offset(, -3)               '¼i¬ù»ù
  15.                 AR(3 + xi) = Rng(3).Offset(, -1)               '³Ì«á¦¨¥æ»ù
  16.                 AR(5 + xi) = Rng(3)                            '¥¼¨R¾P«´¬ù¶q
  17.             End With
  18.             .Value = e
  19.         End With
  20.     Next
  21.     With Sheets("¬ö¿ý").Cells(Rows.Count, "A").End(xlUp).Cells(2, 1)
  22.          'Cells(Rows.Count, "A").End(xlUp):AÄæ³Ì«á¦C©¹¤W¦³¸ê®ÆªºÀx¦s®æ.Cells(2, 1) :²Ä2¦C ,²Ä1Äæ
  23.           .Value = Date
  24.           .Cells(1, 2) = Rng(1)
  25.           .Cells(1, 3).Resize(1, 4) = Rng(1).Cells(1, 4).Resize(1, 4).Value
  26.           .Cells(1, 7).Resize(1, 6) = AR
  27.     End With
  28. End Sub
½Æ»s¥N½X

TOP

¦^´_ 51# usana642
[·í¤é-¦ÛÀç°Ó][·í¤é-§ë«H][·í¤é-¥~¸ê][·í¤é-¦hªÅ²bÃB][¥¼¥­­Ü-¦ÛÀç°Ó][¥¼¥­­Ü-§ë«H][¥¼¥­­Ü-¥~¸ê][¥¼¥­­Ü-¦hªÅ²bÃB]
³o¨ÇÄæ¦ì¬O§ì¨ú  ­pºâ1  ¨º¨Çªº¸ê®Æ??
.Cells(1, 7).Resize(1, 6) = AR µ{¦¡¤¤¨S¬Ý¨ì§ìARªº¸ê®Æ

TOP

¦^´_ 54# usana642
­«ÂI¬O
¬ö¿ý1¤u§@ªí [·í¤é-¦ÛÀç°Ó][·í¤é-§ë«H][·í¤é-¥~¸ê][·í¤é-¦hªÅ²bÃB][¥¼¥­­Ü-¦ÛÀç°Ó][¥¼¥­­Ü-§ë«H][¥¼¥­­Ü-¥~¸ê][¥¼¥­­Ü-¦hªÅ²bÃB] ³o¨ÇÄæ¦ì
§ì¨ú : ­pºâ1¤u§@ªí¤Wªº¨º¨Çªº¸ê®Æ??
  1. Sub Àx¦sOI1()
  2. With Sheets("¬ö¿ý1").Cells(Rows.Count, "A").End(xlUp).Cells(2, 1)
  3. ' *** Sheets("¬ö¿ý1")¤u§@ªíªº A1¶·¥ý¿é¤J¦r¦ê"¤é´Á" ******
  4. ' *** ³o¦æµ{¦¡½X²Ä¤@¦¸°õ¦æ¤~·|¨ì¥¿½Tªº¦ì¸m
  5. 'Cells(Rows.Count, "A").End(xlUp):AÄæ³Ì«á¦C©¹¤W¦³¸ê®ÆªºÀx¦s®æ.Cells(2, 1) :²Ä2¦C ,²Ä1Äæ
  6. .Resize(1, 9) = Array(Date, 2, 3, 4, 5, Sheets("¬ö¿ý1").[F14], [­pºâ1!F14], 8, 9)
  7. 'Date «á­±ªº 2,3,4,5,, ½Ð¦Û¦æ¿é¤J¾A·íªº¦ì¸m
  8. '[­pºâ1!F14] <=> Sheets("¬ö¿ý1").[F14] <=> Sheets("¬ö¿ý1").Range("F14")
  9. End With
  10. End Sub
½Æ»s¥N½X

TOP

¦^´_ 56# 198188
¨º¤@ºô­¶¥i¤W¶Ç»¡©ú,°Ñ¦Ò¬Ý¬Ý

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-12-3 15:51 ½s¿è

¦^´_ 58# 198188
§Ú¥i¥HÀ°§A°µªº¥u¬O,vba¤Wªº»yªk¤Îµ{¦¡¤Wªº½s¼g,§A¶Ç¤W¤@°ïºô§},§Ú²ö®_¦Ï°Õ.
­«ÂI¬O­n¦³»¡©ú§A·Q°µ¤°»ò

TOP

        ÀR«ä¦Û¦b : µÊ®ð¼L¤Ú¤£¦n¡A¤ß¦a¦A¦n¤]¤£¯àºâ¬O¦n¤H¡C
ªð¦^¦Cªí ¤W¤@¥DÃD