- ©«¤l
- 552
- ¥DÃD
- 3
- ºëµØ
- 0
- ¿n¤À
- 578
- ÂI¦W
- 0
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- office 2010
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2015-2-8
- ³Ì«áµn¿ý
- 2024-7-9
|
¦^´_ 9# markbaseball
¤Wzµ{§Ç¥N½X³£¬O«Ü°ò¦ªº»y¥y¡AY§A¦³µ½¥Î°Ï°ìÅܼƵøµ¡¥H¤ÎF8(³v¨B°õ¦æ)¨ÓÆ[¬Ý¨ä¥N½Xªº¸Ü¡C¨ä¹ê¤£¥Î¸ÑÄÀ¡A
´N¥i¥H«Ü®e©öªºÆ[¹î¨äµ{§Çªº¤º®e¥H¤Î·N«ä¡A·|¤ñ§Ú¸ÑÄÀ¡A§ó®e©ö²z¸Ñ¡I¡I
¥H¤U¥N½X¬°¤F¸ÑÄÀ¡Aקï¤FÅܼƦWºÙ(®e©öÆ[¬Ý)¡A¨ä¤º®e¤]¦³°µµy·Lªº×¥¿¡C- Sub ro()
- Dim sht2EndRow As Range, sht2EndColumn As Range
- Dim sht_1 As Worksheet, sht_2 As Worksheet
- Dim rng As Range, findCusIP As Range, sht1EndColumn As Range
- Dim crng As Range, ng As Range
- Set sht_1 = Worksheets("¤u§@ªí1")
- Set sht_2 = Worksheets("¤u§@ªí2")
- Set sht2EndRow = sht_2.[D65535].End(xlUp) '§ä ¤u§@ªí2 ªº DÄæ ³Ì«á¤@Àx¦s®æ¡A¨ä»y¥yªº·N«ä¬°¡G±qÀx¦s®æªºD65535©¹¤W§ä¡A§ä¨ì¦³ÈªºÀx¦s®æ¡A³o¸Ì¤@©wn©¹¤W§ä¡A¦]¬°DÄ欰¤£³sÄòªº½d³ò(¦³ªÅªºÀx¦s®æ)¡A
- Set sht2EndColumn = sht_2.[E1].End(xlToRight) '§ä ¤u§@ªí2 ªº ²Ä¤@¦C ªº³Ì«á¤@Àx¦s®æ¡A¨ä»y¥yªº·N«ä¬°¡G±q E1 ©¹¥k§ä¨ì³Ì«á¦³ÈªºÀx¦s®æ
- Set sht1EndColumn = sht_1.[c1].End(xlToRight) '§ä ¤u§@ªí1 ªº ²Ä¤@¦C ªº³Ì«á¤@Àx¦s®æ
-
- For Each rng In sht_2.Range("D2", sht2EndRow) '¥H¤u§@ªí2ªº D2 ¨ì DÄæ ³Ì«á¤@Àx¦s®æªº½d³ò°µ°j°é´`Àô¡A³o¸Ì«ü¦Vªº½d³ò¬O D2:D1068
- If rng <> "" Then '¦pªG ¥Ø¼ÐÀx¦s®æ rng ¤£¬°ªÅȤ~°õ¦æ¤º³¡»y¥y
- Set findCusIP = sht_1.Columns(2).find(rng, LookIn:=xlFormulas) '¥ý§ä¨ì CusIP ¦bBÄ檺þ¤@ ¦C ªºÀx¦s®æ
- If Not findCusIP Is Nothing Then '¦pªG¦³§ä¨ì CusIP¤~°õ¦æ¤U¦C»y¥y
- For Each crng In sht_2.Range("e1", sht2EndColumn) '¥H¤u§@ªí2 ªº ²Ä¤@¦C ±q E1 ¨ì ²Ä¤@¦C ªº³Ì«á¤@Àx¦s®æªº½d³ò°µ°j°é´`Àô¡A³o¸Ì«ü¦Vªº½d³ò¬O E1:I1
- ''''''¤U±°j°é¶}©l´M§ä
- For Each ng In sht_1.Range("c1", sht1EndColumn) '¥H¤u§@ªí1 ªº C1:KT1 °µ½d³ò ¤ñ¹ï¦~¥÷¥H¤Î¨ä¤U¤@®æªºÀx¦s®æ¤º®e¡A¤ñ¦p¡G1978Return on Equity[Y78]
- ''''''¤U¦Cªº ng.Value & ng.Offset(1).Value(¤u§@ªí1ªº ¦~¥÷©M¦WºÙ) ©M rng.Offset(, -2) & crng.Value & "*"(¤u§@ªí2ªº¦~¥÷©M¦WºÙ) °µ¤ñ¹ï
- ''''''³o¸Ìªº "*" ¬O§â¤u§@ªí1ªº²Ä¤G¦C¦WºÙ¤¤ªº¤¤¬A¸¹¥H¤Î¨ä¤º®e¥h°£±¼(»¡¬O¥h°£±¼¡A¦ýÀ³¸Ó»¡¥i¥H¬O¥ô¦óªº¤º®e)
- If ng.Value & ng.Offset(1).Value Like rng.Offset(, -2) & crng.Value & "*" Then
- sht_2.Cells(rng.row, crng.column) = sht_1.Cells(findCusIP.row, ng.column) '¤ñ¹ï¦¨¥\«á¼g¤JÀx¦s®æ¡A¤ñ¦p»¡ E2¡BF2¡BG2¡BH2¡BI2 ¨Ì¦¹Ãþ±À
- Exit For
- End If
- Next
- '''''''''''''
- Next
- End If
- Set findCusIP = Nothing '·í¦¸ªº°j°éµ²§ô«á¡A³]©w¬°¨S¦³ª«¥ó¡A¥H§Q¤UÓ°j°é·j´M¡A¨S³]ªº¸Ü¡A«h¦³¥i¯à§ä¨ì¿ù»~ªº¸ê®Æ
- End If
- Next
- End Sub
½Æ»s¥N½X |
|