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

[µo°Ý] ¿é¤J¦Ü¤£¦PÄæ¦ìÀx¦s®æ¨Ó­Ó§O§ä¥X¨â­Ó¤u§@ªí¹ïÀ³­È

¦U¦ì¤j¤j

1.Sheet2ªí©MSheet3ªí¬°¸ê®Æ¦C¦U¦³¼Æ¤dµ§¸ê®Æ.
2.Sheet1ªíA:CÄ欰Sheet2¿é¥X°Ï,¦ÓD:GÄ欰Shee ...
luke µoªí©ó 2012-9-20 20:19

Module1
  1. Public v2, v3
½Æ»s¥N½X
ThisWorkBook
  1. Private Sub Workbook_Open()
  2.   Dim rTar As Range
  3.   
  4.   Set v2 = CreateObject("Scripting.Dictionary")
  5.   Set v3 = CreateObject("Scripting.Dictionary")
  6.   
  7.   With Sheets("sheet2")
  8.     For Each rTar In .Range(.[A2], .[A2].End(xlDown))
  9.       v2(rTar & "") = rTar.Row
  10.     Next rTar
  11.   End With
  12.   
  13.   With Sheets("sheet3")
  14.     For Each rTar In .Range(.[A2], .[A2].End(xlDown))
  15.       v3(rTar & "") = rTar.Row
  16.     Next rTar
  17.   End With
  18. End Sub
½Æ»s¥N½X
Sheet1
  1. Private Sub Worksheet_Change(ByVal Target As Range)
  2.   Dim iI%
  3.   Dim rTar As Range
  4.   
  5.   Set rTar = Target
  6.   With rTar
  7.     Select Case .Column
  8.    
  9.       Case 1 ' °Ï¤À
  10.         With .Parent
  11.           For iI = 2 To 3
  12.             .Cells(rTar.Row, iI) = Sheets("sheet2").Cells(v2(rTar.Text), iI)
  13.           Next iI
  14.         End With
  15.    
  16.       Case 4 ' ²¼¸¹
  17.         With .Parent
  18.           For iI = 2 To 4
  19.             .Cells(rTar.Row, iI + 3) = Sheets("sheet3").Cells(v3(rTar.Text), iI)
  20.           Next iI
  21.         End With
  22.    
  23.     End Select
  24.   End With
  25. End Sub
½Æ»s¥N½X
TEST25-ans.zip (38.42 KB)
Àɮפ¤ Sheet1 ¥k¤U¸ê®Æ¬O«O¯d¨ÓÅçÃҥΪº.

TOP

        ÀR«ä¦Û¦b : ­n¥Î¤ß¡A¤£­n¾Þ¤ß¡B·Ð¤ß¡C
ªð¦^¦Cªí ¤W¤@¥DÃD