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

[µo°Ý] ±N¸ê®Æ¼g¤J¨ì¨ä¥L¦h­ÓEXCELÀÉ®×

[µo°Ý] ±N¸ê®Æ¼g¤J¨ì¨ä¥L¦h­ÓEXCELÀÉ®×


§Ú¦³¤T­ÓEXCELÀɮפÀ§O¬°A B C ¦p¹Ï
A¬°­pºâÀɮ׳z¹L«ö¶s±N¸ê®Æ¶Ç°e¨ìB »P C
§PÂ_B »P C¸ê®Æ³Ì«á¤@µ§¸ê®Æ¨Ã¶ñ¤W

¦³¤j­ô¤j©j¼g¹LÃþ¦¡ªºµ{¦¡¶Ü

¦^´_ 22# lpk187


    ÁÂÁ¡A§Ú¤w¸g­×¥¿°ÝÃD¡A·PÁ§AªºÀ°¦£¡A§Ú·|¦n¦n¬ã¨s¡A¼W¥[¸gÅç

TOP

¦^´_ 20# mark761222


    ·|²£¥Í¿ù»~ªº¤u§@ªí¦WºÙ¬°Daily Yield Rate report ¤À¼t 2015BÀɮתº"B DailyYeild (F1-By Date)"©M"T Daily Yeild (F2-By Date )"

TOP

¦^´_ 20# mark761222


    ¦b¶×¥X¸ê®Æ¦b¤¤ªº¤u§@ªí¦WºÙ©M¥Øªºªº¤u§@ªí¦WºÙ¦³»~¡A¥i¯à¬O¦]¬°ªÅ®æªºÃö«Y¡A½Ð¦Û¦æ­×¥¿§_«h·|¦³ aaa.png ªº¿ù»~²£¥Í
  1. Sub «ö¶s1_Click()
  2.     Application.ScreenUpdating = False
  3.     Dim d As Object
  4.     Dim xlPath As Variant, xlFile As Variant, aa As Variant
  5.     Dim Rng As Range, Rn As Range, Ran As Range, ch As Range
  6.     Dim myRow As Integer, myCol As Integer, k As Integer, I As Integer, j As Integer, xlRow As Integer
  7.     xlPath = ThisWorkbook.Path & "\"
  8.     Set d = CreateObject("scripting.dictionary") '³]©wd¬°¦r¨åª«¥ó
  9.     With Sheets("¶×¥X¸ê®Æ")
  10.         For Each Rng In .Range("A3", Cells(Rows.Count, 1).End(xlUp)) '¦¹°j°é¬OŪ¨úÀɮצWºÙ
  11.             If Rng <> "" Then
  12.                 d(Rng.Value) = ""
  13.             End If
  14.         Next
  15.         myRow = .Cells(Rows.Count, 1).End(xlUp).Row '¬d¸ß"¶×¥X¸ê®Æ"ªº³Ì«á¤@¦C¦ì¸m
  16.         For Each Rng In .Range("B2", .Cells(myRow, 2)) '¦¹°j°é°µ ¦³¸ê®ÆRange¦ì¸mªºÁp¶° Union¡AŪ¨ú¤u§@ªí¦WºÙ
  17.             If Rng <> "" Then
  18.                 k = k + 1
  19.                 If k = 1 Then
  20.                     Set Rn = Rng
  21.                 Else
  22.                     Set Rn = Union(Rn, Rng)
  23.                 End If
  24.             End If
  25.         Next
  26.     End With
  27.         xlFile = d.keys '±N¦r¨åªºkey­Èµ¹¤©xlFile(¬°°}¦C)¡A¥H¥Ø«eŪ¨úªºÀɮצWºÙ¦³"Daily Yield Rate report ¤À¼t 2015BR"
  28.                         '¥H¤Î"Daily Yield Rate report(EN)2015BR4"2­ÓÀÉ®×
  29.         
  30.     For I = 0 To UBound(xlFile) '¥HÀɮ׬°°µ¬°°j°é¡A¨Ó¶}±ÒÀÉ®×
  31.         With Workbooks.Open(xlPath & xlFile(I) & ".xlsx") '¶}±ÒÀÉ®×
  32.             For Each Ran In Rn '°õ¦æ¤u§@ªí°j°é
  33.                 If Ran.Offset(, -1) Like xlFile(I) Then '¤ñ¹ï¦¹¤u§@ªí¬O§_ÄÝ©óxlFile(I)ÀɮסA¦pªG¬O«h°õ¦æIf¤¤µ{§Ç
  34.                     With .Sheets(Ran.Value)
  35.                         Set ch = .Columns(1).Find(Ran.Offset(, 1), LookAt:=xlWhole, SearchDirection:=2)
  36.                         'Àˬd¤é´Á¬O§_¦³­«½Æ¡A·íchÅܼƬ°Nothing®É¡A«hµLµo²{­«½Æ¤é´Á¡A§_«hÂ÷¶}³o¤@¦¸ªº¸ê®ÆÀx¦s¡A¨Ã°õ¦æ¤U¤@­Ó°j°é
  37.                         If Not ch Is Nothing Then MsgBox Ran & "¤u§@ªí¤¤ªº" & ch & "¸ê®Æ¤w¦s¦b¡A¤£·|Àx¦s¸ê®Æ": Set ch = Nothing: GoTo 10
  38.                         myCol = ThisWorkbook.Sheets("¶×¥X¸ê®Æ").Cells(Ran.Row, Columns.Count).End(xlToLeft).Column
  39.                         xlRow = .Cells(Rows.Count, 1).End(xlUp).Row + 1 'Ū¨ú¥Øªº¤u§@ªíªº³Ì«á¤@¦C¦C¸¹
  40.                         For j = 1 To myCol - 2
  41.                             If Ran.Offset(, j).Interior.Color <> 65535 Then '·íÀx¦s®æ¦â±m¤£ÄÝ©ó¶À¦â¡A«h°õ¦æ½Æ»s­È
  42.                                 .Cells(xlRow, j) = Ran.Offset(, j).Value '½Æ»s­È
  43.                             End If
  44.                         Next
  45. 10:
  46.                     End With
  47.                 End If
  48.             Next '§¹¦¨¤@­Ó¤u§@ªí«á°õ¦æ¤U¤@­Ó¤u§@ªí
  49.             .Close True 'Ãö³¬¤ÎÀx¦sÀÉ®×
  50.         End With
  51.     Next
  52.     Application.ScreenUpdating = False
  53. End Sub
½Æ»s¥N½X

TOP

¦^´_ 19# lpk187

©êºp§Ú¥i¯à»¡©úªº¤£°÷¸Ô²Ó¡A§Ú±NÀÉ®×­«·s¾ã²z¥ÎÃC¦â¤À¶}¤F
ªþ¥ó¤¤¦³EXCELÀÉ®×»P¹Ï¤ù»¡©ú

¶À¦â°Ï¶ô¸õ¶}¤£½Æ»s¹L¥h¡A¦]¬°¦³¨ç¼Æ¤£§Æ±æÂл\
¸ê®Æ·J¾ã¨º³¡¤À¡AÀx¦s®æ¬O¤£·|Åܰʪº¡A©Ò¥H±q¨ºÃäµo¥X¼Æ¾Úµ¹¦U­Óexcleªº¤u§@ªí¡A¦pªG«e­±¤é´Á¬Û¦P¤£¼g¤J

¤£ª¾¹D³o¼Ë°÷¤£°÷²M°£¡A¦pªG­þ¸Ì¤£À´¦A¸ò§ÚÁ¿
ÁÂÁÂ

¹Ï¤ù»¡©ú.rar (847.13 KB)
Àɮ׶ץX.rar (749.76 KB)

TOP

¦^´_ 18# mark761222


    ¦pªG T»PB¸òCªº ¤£·|½Æ»sªº¦a¤è¤£¤@¼Ë ¡AÁÙ¦³±NÀɮפÀ¦Ü2­Óexcel«ç»ò§ó§ï©O?
¤£·|½Æ»sªº¦a¤è¡A§Ú¸Ó«ç»ò¼Ë¥h§PÂ_¡H¦ì¸m¡HÃC¦â¡H§¹¥þ¨S¦³³W«h¡I
¶×¥X¸ê®Æ¤u§@ªí¤¤¡A¦³¦n´X­ÓTabl¡A¦ì¸m·|¤£·|¤£¦P¡H¸Ó«ç»ò¹q¸£¥h§P§O¥¦ªº±Ò©l¦ì¸m¡H¥¦¥¼¨Óªº¦ì¸m·|©Mªþ¥ó¤@¼Ë¡H
¦A¨Ó¬O¦X¨ÖÀx¦s®æ¡AVBA§P§O¸ê®Æ¡A­Y¹J¨ì¦X¨ÖÀx¦s®æ¡A³Ì®e©ö¥X¿ù¤F¡C

¬Ý¤F§Aªºªþ¥ó¡A¦pªG¾ã¦X¦b¤@°_¡A©Z¥Õ»¡«ÜÃø¡I
¦Ü©ó¡A­n¤À¦h­ÓÀɮסA©Î¦h­Ó¤u§@ªí¤£¬OÃø¨Æ¡AÃøªº¬O­n¶×¥Xªº¸ê®Æ¡A§¹¥þ¨S¦³¨t²Î©Êªº³W¹º¡I

TOP

¦^´_ 17# lpk187

Àɮ׶ץX.rar (701.29 KB)

¦pªG T»PB¸òCªº ¤£·|½Æ»sªº¦a¤è¤£¤@¼Ë ¡AÁÙ¦³±NÀɮפÀ¦Ü2­Óexcel«ç»ò§ó§ï©O?¡A¦pªþ¥ó
¦³¤T­ÓÀɮ׸ò¤W¤@¦¸¤£¤@¼Ë¡A¦pªG¦h¤@­Óexcel¡AÁÙ¦³TB¦ì¤l¤£¦P¡C
¬Ý¤F§Aªº±Ð¾Ç¡A§Ú³»¦h¥u¯à§â¥¦¤À¦¨2­Ó¤u§@ªí¥h¶]¡A¦pªG¾ã¦X¦b¤@°_¡A«ç»òÅý¥L¥h§P§O©O

TOP

¦^´_ 16# mark761222

§Ú¥H¤U¹Ï¨Ó¸ÑÄÀ µ{¦¡¡A§ó¸Ô²Óªº¤èªk¡A§A¥i¥H§Q¥Î F8³v¦æ¨Ó°õ¦æµ{¦¡¡A¨Ã§Q¥Î°Ï°ìÅܼƼƵøµ¡¨ÓÆ[¬Ýµ{¦¡ «ç»ò¨«ªº

   

TOP

¦^´_ 15# lpk187


ÁÂÁÂ! ¶¶§Q¹B§@¡A¦ý¬O´X¥G¬Ý¤£À´¡A¤£ª¾¹D¥LªºÅÞ¿è«ç»ò¥h§PÂ_¨ú±o¾ã­Ó¸ê®Æ¥á¨ì¤u§@ªí1 ¡B2 ¡B3   µ{«×®t¤Ó¦h¤F@_@

¥»¨Ó·Q¦Û¤v§ï§¹®M¥Î¨ì¥t¤@­Ó¤u§@ªí¡A¬Ý¨Ó¦³¨ÇÃø«×¡A§Æ±æµ¥§Ú¾ã²z§¹¸ê®Æ§¹¡A¯à¦bÀ°§Ú¸Ñµª¡AÁÂÁÂ

TOP

¦^´_ 14# mark761222


    ¦³2ºØ¤è¦¡¡A½Ð¦Û¦æ´ú¸Õ¡A¿ï¾Ü¦Û¤vªº»Ý¨D¡A¤@ºØ¬°¦³¨ç¼ÆªºÀx¦s®æ´N¼g¤J¨ç¼Æ¡A¦ýŲ©ó¦³¥i¯à°µ·L½Õ¬G¦³²Ä¤GºØ¤è¦¡¡A¸õ¹L¦³¨ç¼ÆªºÀx¦s®æ
  1. Option Explicit
  2. Sub Ex() '¤è¦¡1¬°¼g¤J¨ç¼Æ
  3.     Dim xlPath As Variant, xlFile As Variant
  4.     Dim Rng As Range, Rn As Range, Ran As Range, ch As Range
  5.     Dim myCol As Integer, myRow As Integer, k As Integer
  6.     Dim xlRo As Integer
  7.     Dim arr
  8.     xlPath = ThisWorkbook.Path & "\" 'Ū¨ú¥»µ{¦¡Àɪº¸ô®|
  9.     xlFile = "¨C¤é§ó·s±µ¦¬.xlsx" 'Ū¨ú¥»µ{¦¡ÀɦWºÙ
  10.     With ThisWorkbook.Sheets("¤u§@ªí1")
  11.         myCol = .Cells(1, Columns.Count).End(xlToLeft).Column '¬d¸ß¤u§@ªí1ªº³Ì«á¤@Äæ¦ì¸m
  12.         myRow = .Cells(Rows.Count, 1).End(xlUp).Row '¬d¸ß¤u§@ªí1ªº³Ì«á¤@¦C¦ì¸m
  13.         For Each Rng In .Range("A2", .Cells(myRow, 1)) '¦¹°j°é°µ ¦³¸ê®ÆRange¦ì¸mªºÁp¶° Union
  14.             If Rng <> "" Then
  15.                 k = k + 1
  16.                 If k = 1 Then
  17.                     Set Rn = Rng
  18.                 Else
  19.                     Set Rn = Union(Rn, Rng)
  20.                 End If
  21.             End If
  22.         Next
  23.     End With
  24.     Workbooks.Open (xlPath & xlFile) '¥´¶}"¨C¤é§ó·s±µ¦¬.xlsx"¬¡­¶Ã¯
  25.     For Each Ran In Rn
  26.         With Workbooks(xlFile).Sheets(Ran.Value)
  27.             Set ch = .Columns(1).Find(Ran.Offset(, 1), LookAt:=xlWhole, SearchDirection:=2)
  28.             'Àˬd¤é´Á¬O§_¦³­«½Æ¡A·íchÅܼƬ°Nothing®É¡A«hµLµo²{­«½Æ¤é´Á¡A§_«hÂ÷¶}³o¤@¦¸ªº¸ê®ÆÀx¦s¡A¨Ã°õ¦æ¤U¤@­Ó°j°é
  29.             If Not ch Is Nothing Then MsgBox Ran & "¤u§@ªí¤¤ªº" & ch & "¸ê®Æ¤w¦s¦b¡A¤£·|Àx¦s¸ê®Æ": Set ch = Nothing: GoTo 10
  30.             arr = Ran.Offset(, 1).Resize(, myCol - 1)
  31.             ''''§â¤½¦¡´À´«°}¦C¤¤ªº­È'''
  32.             arr(1, 5) = "=SUM(RC[5]:RC[13])"
  33.             arr(1, 6) = "=1-RC[-1]/RC[-2]"
  34.             arr(1, 8) = "=SUM(RC[12]:RC[18])"
  35.             arr(1, 9) = "=1-RC[-1]/RC[-2]"
  36.             arr(1, 29) = "=SUM(RC[5]:RC[10])"
  37.             arr(1, 30) = "=1-RC[-1]/RC[-2]"
  38.             arr(1, 48) = "=SUM(RC[2]:RC[11])"
  39.             arr(1, 49) = "=1-RC[-1]/RC[-2]"
  40.             ''''
  41.             xlRo = .Cells(Rows.Count, 1).End(xlUp).Row + 1
  42.             .Cells(xlRo, 1).Resize(, UBound(arr, 2)) = arr '¼g¤J¸ê®Æ
  43.         End With
  44. 10:
  45.     Next
  46.     Workbooks(xlFile).Close True 'Ãö³¬"¨C¤é§ó·s±µ¦¬.xlsx"¬¡­¶Ã¯
  47. End Sub

  48. Sub Ex1() '¤£¼g¤J¨ç¼Æ¸õ¹L¦³¨ç¼ÆªºÀx¦s®æ
  49.     Dim xlPath As Variant, xlFile As Variant
  50.     Dim Rng As Range, Rn As Range, Ran As Range, ch As Range
  51.     Dim myCol As Integer, myRow As Integer, k As Integer, I As Integer
  52.     Dim xlRo As Integer
  53.     Dim arr
  54.     xlPath = ThisWorkbook.Path & "\" 'Ū¨ú¥»µ{¦¡Àɪº¸ô®|
  55.     xlFile = "¨C¤é§ó·s±µ¦¬.xlsx" 'Ū¨ú¥»µ{¦¡ÀɦWºÙ
  56.     With ThisWorkbook.Sheets("¤u§@ªí1")
  57.         myCol = .Cells(1, Columns.Count).End(xlToLeft).Column '¬d¸ß¤u§@ªí1ªº³Ì«á¤@Äæ¦ì¸m
  58.         myRow = .Cells(Rows.Count, 1).End(xlUp).Row '¬d¸ß¤u§@ªí1ªº³Ì«á¤@¦C¦ì¸m
  59.         For Each Rng In .Range("A2", .Cells(myRow, 1)) '¦¹°j°é°µ ¦³¸ê®ÆRange¦ì¸mªºÁp¶° Union
  60.             If Rng <> "" Then
  61.                 k = k + 1
  62.                 If k = 1 Then
  63.                     Set Rn = Rng
  64.                 Else
  65.                     Set Rn = Union(Rn, Rng)
  66.                 End If
  67.             End If
  68.         Next
  69.     End With
  70.     Workbooks.Open (xlPath & xlFile) '¥´¶}"¨C¤é§ó·s±µ¦¬.xlsx"¬¡­¶Ã¯
  71.     For Each Ran In Rn
  72.         With Workbooks(xlFile).Sheets(Ran.Value)
  73.             Set ch = .Columns(1).Find(Ran.Offset(, 1), LookAt:=xlWhole, SearchDirection:=2)
  74.             'Àˬd¤é´Á¬O§_¦³­«½Æ¡A·íchÅܼƬ°Nothing®É¡A«hµLµo²{­«½Æ¤é´Á¡A§_«hÂ÷¶}³o¤@¦¸ªº¸ê®ÆÀx¦s¡A¨Ã°õ¦æ¤U¤@­Ó°j°é
  75.             If Not ch Is Nothing Then MsgBox Ran & "¤u§@ªí¤¤ªº" & ch & "¸ê®Æ¤w¦s¦b¡A¤£·|Àx¦s¸ê®Æ": Set ch = Nothing: GoTo 20
  76.             xlRo = .Cells(Rows.Count, 1).End(xlUp).Row + 1
  77.             For I = 1 To myCol - 1
  78.                 If I = 5 Or I = 6 Or I = 8 Or I = 9 Or I = 29 Or I = 30 Or I = 48 Or I = 49 Then GoTo 10 '¤£¼g¤J¨ç¼Æ¸õ¹L¦³¨ç¼ÆªºÀx¦s®æ
  79.                 .Cells(xlRo, I) = Ran.Offset(, I)
  80. 10:
  81.             Next
  82.         End With
  83. 20:
  84.     Next
  85.     Workbooks(xlFile).Close True 'Ãö³¬"¨C¤é§ó·s±µ¦¬.xlsx"¬¡­¶Ã¯
  86. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¤â¤ß¦V¤U¬O§U¤H¡A¤â¤ß¦V¤W¬O¨D¤H¡F§U¤H§Ö¼Ö¡A¨D¤Hµh­W¡C
ªð¦^¦Cªí ¤W¤@¥DÃD