- ©«¤l
- 6
- ¥DÃD
- 2
- ºëµØ
- 0
- ¿n¤À
- 8
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- office2013
- ¾\ŪÅv
- 10
- µù¥U®É¶¡
- 2016-4-12
- ³Ì«áµn¿ý
- 2016-12-23
|
¦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 ½Ð°Ý¸Ó«ç»òקï?? |
|