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

[µo°Ý] vba ¸ê®Æ¤ñ¹ï

[µo°Ý] vba ¸ê®Æ¤ñ¹ï

¦U¦ì¤j¤j:
                 §Ú²{¦b¦³¨â­Ó¤u§@ªí¡A§Ú­º¥ý»Ý­n¤ñ¹ïworkbook1 ©Mworkbook2ªº id¬O§_¬Û¦P¡A¦pªGid¬Û¦P¦A¤ñ¹ï¤é´Á¡A¤é´Á¤]¤@­Pªº¸Ü´N§âworkbook 1ªº­È ¶K¨ìworkbook2 ¡C
        Workbook1                                                      workbook2
ID         ¤é´Á               MV                                 ID         ¤é´Á               MV
1      2000/1/1          50                                    1         2000/1/2
1      2000/1/2          52                                    2          2000/1/6
1      2000/1/3          54                                    3          2000/1/7
1      2000/1/4          53                                   
2     2000/1/5            60
2      2000/1/6           61
3     2000/1/7            52


Sub marketvalue()
Dim i, j As Integer
Dim tt, cc As Date
    Set tbill = Workbooks("mv").Sheets("data")
    Set aaa = Workbooks("°]°È¸ê®Æ").Sheets("sheet2")
      For i = 2 To 1048576
      For j = 2 To 1148
       Let BCODE = tbill.Cells(i, 1)
       tt = tbill.Range("B" & i).Value
       cc = aaa.Range("A" & j).Value
        With aaa.Range("E:E")
            Set c = Cells.Find(what:=BCODE, After:=ActiveCell, LookIn:= _
                               xlFormulas, LookAt:=xlWhole, SearchOrder:=xlByRows, _
                                SearchDirection:=xlNext, MatchCase:=False).Activate

            If Not c Is Nothing Then
                       With aaa.Range("A:A")
                            Set dd = Cells.Find(what:=tt, After:=ActiveCell, LookIn:= _
                               xlFormulas, LookAt:=xlWhole, SearchOrder:=xlByRows, _
                               SearchDirection:=xlNext, MatchCase:=False).Activate
                                     If Not dd Is Nothing Then
                                        tbill.Cells(i, 5).Copy Destination:=aaa.Cells(j, 15)
                                     End If
                       End With
            End If
         End With
     Next j
     Next i
End Sub

¦ý¬O³o¦æ«o¥X²{¨S¦³³]©wª«¥óÅܼƩÎwith°Ï¶ôÅܼơA ½Ð°Ý¸Ó«ç»ò­×§ï??

¦^´_ 1# markbaseball

­º¥ý §Aªº¬Y¤@¦æµ{¦¡½X¥´¿ù¤F(¶Ü?!)
Let BCODE = tbill.Cells(i, 1)
Let­n§ïSet§a?

TOP

        ÀR«ä¦Û¦b : ¤Ó¶§¥ú¤j¡B¤÷¥À®¦¤j¡B§g¤l¶q¤j¡A¤p¤H®ð¤j¡C
ªð¦^¦Cªí ¤W¤@¥DÃD