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

½Ð°ÝsheetÂà´«ªº°ÝÃD

½Ð°ÝsheetÂà´«ªº°ÝÃD

½Ð°Ýsheet1¬O­ìÀÉ(¸ê®Æ®w)
¦p¦óÂà´«¦¨sheet2
Ãþ¦üvlookupªº°µªk
¨ÌBÄ檺¼Æ¦r¡]¶¶§Ç¥´¶Ã¡^¨Ì§Ç¶ñ¤JC~JÄ檺¸ê®Æ
A¡BBÄæ¥i¥H©¹«á¦AÄ~Äò©µ¦ù

ÁÂÁÂ

sheet-vlookup.rar (5.8 KB)

Tony

¦^´_ 1# tonycho33
sheet1¬O­ìÀÉ(¸ê®Æ®w) Âà´«¦¨sheet2   ¬Ý¤£¥X®t§O¦b­þ¸Ì,¦p¦óÂà´«¤]¬Ý¤£À´

TOP

¦^´_ 2# GBKEE

¬O­n¬dªí°Õ!
ª`·NSHEET1»PSHEE2¤§BÄæ¬O¤£¦Pªº
¦bSHEE2 BÄæ¿é¤J±ý¬d¸ß¤§¸ê®Æ,§Y¬d¥X¬Û¹ïÀ³C~JÄ檺¸ê®Æ(¦³3¦C)

¥»ÃD¬O­n¥Îµ{¦¡¼g
¥t¤@ÃD(¦p¤U)¬O¥Î¤½¦¡¼g
sheet-vlookup.zip (4.45 KB)

TOP

¥»©«³Ì«á¥Ñ register313 ©ó 2012-1-18 14:16 ½s¿è

¦^´_ 1# tonycho33
  1. Sub VLOOKUP()
  2. '²M°£Sheet2¤§C~JÄæ
  3. Sheet2.Columns("C:J") = ""
  4.    '±qSheet2¤§²ÄR¦C(²Ä2¦C)¶}©l
  5.    R = 2   
  6.    '°õ¦æ°j°é,ª½¨ìSheet2 R¦CBÄ椧­È=""
  7.    Do Until Sheet2.Cells(R, "B") = ""
  8.       'FIND¨ç¼Æ:¦bSheet1.Range("B1:B65535")¤º´M§äSheet2.Cells(R, "B")¤§­È,§ä¨ì®É±N¦ì§}¶Çµ¹S
  9.       Set S = Sheet1.Range("B1:B65535").Find(Sheet2.Cells(R, "B"), , , xlWhole)
  10.       '¦bSheet1§ä¨ì¤§¦ì§}¥k°¾²¾1®æ¨ÃÂX¤j¬°3¦C8Äæ ½Æ»s¨ì Sheet2
  11.       S.Offset(0, 1).Resize(3, 8).Copy Sheet2.Cells(R, "C").Resize(3, 8)
  12.       '¤U¤@­Ó­n´M§äªº¦C(²Ä5¦C)(²Ä8¦C)...
  13.       R = R + 3
  14.    'ªð¦^°j°é
  15.    Loop
  16. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-1-18 10:17 ½s¿è

¦^´_ 4# register313
¤]¥i¦p¦¹
  1. Option Explicit
  2. Private Sub Worksheet_Change(ByVal Target As Range)
  3.     'Target:µ{¦¡©Ò±µ¦¬ªºÅܼÆ, As Range:  Àx¦s®æ(ª«¥ó)
  4.     Dim xMatch As Variant, Rng As Range
  5.     Application.EnableEvents = False
  6.     If Target.Column = 2 And Target.MergeCells Then  '¦bBÄæ ¥B¬O MergeCells(½d³ò©Î¼Ë¦¡¥]§t¦X¨ÖÀx¦s®æ)
  7.         Set Rng = Target.Offset(, 1).Resize(3, 8)
  8.         With Sheets("SHEET1")
  9.             xMatch = Application.Match(Target, .[B:B], 0)  'Match(¤u§@ªí¨ç¼Æ)
  10.             If IsNumeric(xMatch) Then                      '§ä¨ì¶Ç¦^¼Æ¦r
  11.                 Rng = .Cells(xMatch, "B").Offset(, 1).Resize(3, 8).Value
  12.             Else
  13.                 Rng.Value = ""
  14.             End If
  15.         End With
  16.     End If
  17.     Set Rng = Nothing                               'ÄÀ©ñÅܼÆ
  18.     Application.EnableEvents = True
  19. End Sub
½Æ»s¥N½X

TOP

¦^´_ 5# GBKEE


    ¥i¥H¸ÑÄÀ¤@¤U¶Ü
ÁÂÁÂ
Tony

TOP

¥»©«³Ì«á¥Ñ tonycho33 ©ó 2012-1-18 14:12 ½s¿è

¦^´_ 4# register313


    ½Ð°Ý§Ú²{¦b®æ¦¡°µ¤F¤@ÂIÅÜ°Ê
  1. Sub VLOOKUP()
  2. Sheet2.Columns("G:S") = ""
  3. R = 2                                 
  4.    Do Until Sheet2.Cells(R, "A") = ""  
  5.       Set S = Sheet1.Range("A1:A65535").Find(Sheet2.Cells(R, "A"), , , xlWhole)                                   
  6.       S.Offset(0, 5).Resize(3, 13).Copy Sheet2.Cells(B, "G").Resize(3, 13)                                    
  7.       R = R + 3                                       
  8.    Loop
  9. End Sub
½Æ»s¥N½X
½Ð¨ó§U¬Ý¬°¦óµLªk°õ¦æ
¥t¥~,¨Ï¥Î¨ç¼Æ­n¦p¦ó­×§ï
­ì¨ç¼Æ
C2=OFFSET(INDEX(Sheet1!$A$1:$J$20,MATCH($B2,Sheet1!$B$1:$B$20,0),COLUMN()),MOD(ROW()+1,3),0)
ÁÂÁÂ

sheet-vlookup.rar (8.28 KB)

Tony

TOP

¦^´_ 7# tonycho33

µ{¦¡
sheet-vlookupµ{¦¡.rar (9.3 KB)

¨ç¼Æ
G2=OFFSET(INDEX(Sheet1!$A:$R,MATCH($A2,Sheet1!$A:$A,0),COLUMN()-1),MOD(ROW()+1,3),0)
G3=OFFSET(INDEX(Sheet1!$A:$R,MATCH($A2,Sheet1!$A:$A,0),COLUMN()-1),MOD(ROW()+1,3),0)
G4=OFFSET(INDEX(Sheet1!$A:$R,MATCH($A2,Sheet1!$A:$A,0),COLUMN()-1),MOD(ROW()+1,3),0)
G2 G3 G4¤½¦¡¬Û¦P

¿ïG2:G4 ¦V¥k©Ô
¦V¤U©Ô

TOP

¦^´_ 8# register313


    §A¦n
½Ð°Ý¤@¤U
¦bsheet2ªºAÄæÀx¦s®æ¤º¡A¦pªG¿é¤Jªº­È¤£¬Osheet1 ªºAÄæ­È®É
¨Ò¦p
A23¡ãA25¡×3332
A26¡ãA28¡×3334
³o¼Ëªº®É­Ô
µ{¦¡°õ¦æ·|¥X²{¿ù»~¡A¥i§_¿é¤J­È¤£¤@¼Ë®É¡AG¡ãSÄæ¥u¥X²{ªÅ¥Õ
­n¦p¦ó¸Ñ¨M­×§ï©O
ÁÂÁÂ

sheet-vlookupµ{¦¡.rar (9.3 KB)

Tony

TOP

¦^´_ 9# tonycho33
  1. Sub VLOOKUP()
  2. Sheet2.Columns("G:S") = ""   '²M°£Sheet2¤§G~SÄæ
  3. R = 2   '±qSheet2¤§²ÄR¦C(²Ä2¦C)¶}©l
  4.    Do Until Sheet2.Cells(R, "A") = ""  '°õ¦æ°j°é,ª½¨ìSheet2 R¦CAÄ椧­È=""
  5.       Set s = Sheet1.Range("A1:A65535").Find(Sheet2.Cells(R, "A"), , , xlWhole)  'FIND¨ç¼Æ:¦bSheet1.Range("A1:A65535")¤º´M§äSheet2.Cells(R, "A")¤§­È,§ä¨ì®É±N¦ì§}¶Çµ¹S
  6.           If Not s Is Nothing Then     '·j´M­È§ä¨ì®É¦A§@¼g¤J
  7.              s.Offset(0, 5).Resize(3, 13).Copy Sheet2.Cells(R, "G").Resize(3, 13)    '¦bSheet1§ä¨ì¤§¦ì§}¥k°¾²¾5®æ¨ÃÂX¤j¬°3¦C13Äæ ½Æ»s¨ì Sheet2
  8.           End If
  9.       R = R + 3     '¤U¤@­Ó­n´M§äªº¦C(²Ä5¦C)(²Ä8¦C)...
  10.    Loop  'ªð¦^°j°é
  11. End Sub
½Æ»s¥N½X
sheet-vlookupµ{¦¡.rar (9.29 KB)

TOP

        ÀR«ä¦Û¦b : ¤H¥Í³Ì¤jªº¦¨´N¬O±q¥¢±Ñ¤¤¯¸°_¨Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD