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

¤£¦P¤u§@ªí¤ºªº¸ê®Æ¤ñ¹ï»P¶ñ¤J.

¤£¦P¤u§@ªí¤ºªº¸ê®Æ¤ñ¹ï»P¶ñ¤J.

¥»©«³Ì«á¥Ñ MRSA ©ó 2011-1-9 17:41 ½s¿è

Worksheet 1:
¡@¡@¡@A¡@¡@¡@B¡@¡@¡@C
1¡@¡@12¡@¡@aaa¡@¡@high
2¡@¡@84¡@¡@daw¡@¡@light
3¡@¡@28¡@¡@add¡@¡@done

Worksheet 2:
¡@¡@¡@A¡@¡@¡@B
1¡@¡@28¡@¡@sale
2¡@¡@45¡@¡@lock
3¡@¡@84¡@¡@lock

§Ú·Q¨Ì·Ó¨â­Ó¤u§@ªí¤¤ªºAÄæ¦ì¤ºªº¼Æ­È¤ñ¹ï¥XWorksheet 2¸ÌBÄæ¦ìªº­È¡A¨Ã¶ñ¦ÜWorksheet 1 ªºDÄæ¦ì¤º¡A­YWorksheet 2¤º¨S¦³Worksheet 1¸ÌAÄæ¦ì¤ºªº¼Æ¸ê¡A«hDÄæ¦ìÅã¥ÜªÅ¥Õ¡C
°õ¦æµ²ªG¦p¤U¡G
Worksheet 1:
¡@¡@¡@A¡@¡@¡@B¡@¡@¡@C¡@¡@¡@D
1¡@¡@12¡@¡@aaa¡@¡@high¡@¡@
2¡@¡@84¡@¡@daw¡@¡@light¡@¡@lock
3¡@¡@28¡@¡@add¡@¡@done¡@¡@sale

½Ð°Ý§Ú¸Ó«ç»ò¼g»yªk?
§Ú¥Î¨ç¼Ævlookup¼gªº®É­Ô¡A¥u­n¦bworksheet 2¸Ì§ä¤£¨ì¸ê®Æ®É¡Avba´N¥d¦í¤F¡C

¥»©«³Ì«á¥Ñ asus103 ©ó 2011-1-9 17:45 ½s¿è

©óSHEET 1 ªºD1¤¤¼g¤J
=IF(ISERROR(VLOOKUP(A1,Sheet2!A:B,2,FALSE)),"",VLOOKUP(A1,Sheet2!A:B,2,FALSE))
¦A¦V¤U©Ô
ASUS

TOP

¦^´_ 2# asus103


¨Ï¥Îexcel¨ç¼Æ³o­Ó§Úª¾¹D«ç»ò¼g.
§Úªº°ÝÃD¬O,§Ú­n¨Ï¥ÎVBA¶i¦æ³o¶µ¤u§@.§Ú¸Ó«ç»ò¼g»yªk?

TOP

¦^´_ 3# MRSA
  1. Sub Ex()
  2.     Dim E As Range, I
  3.     For Each E In Sheet1.Range("A:A").SpecialCells(xlCellTypeConstants)
  4.         I = Application.Match(E, Sheet2.Range("A:A"), 0)
  5.         If IsNumeric(I) Then E.End(xlToRight).Offset(, 1) = Sheet2.Cells(I, "B")
  6.     Next
  7. End Sub
½Æ»s¥N½X

TOP

¦^´_ 4# GBKEE


ÁÂÁÂ.
³o¬O§Ú¨S¥Î¹Lªº»yªk.
°ÝÃD±o¨ì¸Ñ¨M¤F.
¦A¨Ó§Ú·|¬ã¨s¤@¤U³o¨Ç»yªkªº¤º®e.

TOP

¦^´_ 4# GBKEE

½Ð°Ý  «Å§i¦¡
        1).Dim E As Range , I   ©M    Dim  E, I  As Range   ¬O¤@¼Ëªº·N«ä¶Ü?

        2).For Each E In Sheet1.Range("A:A").SpecialCells(xlCellTypeConstants)
            ¤¤¦pªG¥u³o¼Ë¼g  Sheet1.range("A:A")  ©M  Sheet1.Range("A:A").SpecialCells(xlCellTypeConstants) ªº®t§O¦b¨º¸Ì? ¤£¬O³£·|±½´y¤@¹M¶Ü?

        3).I = Application.Match(E, Sheet2.Range("A:A"), 0)
            ³o¼Ë¤@¦æ³o·|¦bSheet2.Range("A:A")±½´y¥X¬Ûµ¥ªº¸ê¶Ü?

        4.)If IsNumeric(I) Then E.End(xlToRight).Offset(, 1) = Sheet2.Cells(I, "B")
            ¬°¤°»ò­n§@°µ  IsNumeric(I) ³o­Ó°Ê§@ ©O?
V98

TOP

³o«h¦n¹³¦³¦Ò¸Õªº·Pı
¤@¬Ý¨ì²Ä1¶µ´Nª¾¹D¤£¤@¼Ë
Á|­Ó¨Ò¤l
Sub DimAs1()
Dim Mynum1, Mynum2 As Integer '³o±ø Mynum1 ¤£·|ÅÜInteger
Dim Total As Integer, MyString As String * 4 '¦r¦êªø«×¬°4

    MyString = _
    "¼¶¼g¤p§Þ¥©": MsgBox MyString: MsgBox TypeName(MyString)

End Sub

TOP

¦^´_ 7# HUNGCHILIN

   ªü¦Nª©¥D:¤£¬O¦Ò¸Õ,¬O¯uªº¤£À´,¸g¹L§Aªº¸ÑÄÀ·N«ä¬O³o¼Ëªº¶Ü?

   Dim a, b As Intger

   1)a ©M b ªº«¬§O¬O¤£¤@¼Ëªº. (a ¬O Variant <Excel ªº¹w³]«¬§O> ), b ¬OInteger .
   2)·N«ä¬O Dim «á­±ªº",", ¬O¤@­Ó¤@­ÓÅܼƪº¤À¹j, ¨C­ÓÅܼƳ£¬O¿W¥ßªº.

   §Æ±æ³o¦¸¯uªº·dÀ´¤F,¼g VBA ®É±`¦b³o¸Ì¥X¿ù.
V98

TOP

¦^´_ 6# linshin1999


            2).For Each E In Sheet1.Range("A:A").SpecialCells(xlCellTypeConstants)
            ¤¤¦pªG¥u³o¼Ë¼g  Sheet1.range("A:A")  ©M  Sheet1.Range("A:A").SpecialCells(xlCellTypeConstants) ªº®t§O¦b¨º¸Ì? ¤£¬O³£·|±½´y¤@¹M¶Ü?
³o¬O¤£¦Pªº¡ASpecialCells(xlCellTypeConstants)¬O±`¼ÆÀx¦s®æ¡A¤]´N¬O·|²¤¹LªÅ®æ¡C§A¥Î¿ý»s¥¨¶°¤è¦¡¡A¿ï¨úAÄæ/±`¥Î/´M§ä»P¨ú¥N/¯S®í/±`¼Æ¬Ý¬Ýµ{¦¡½X´Nª¾¹D
        3).I = Application.Match(E, Sheet2.Range("A:A"), 0)
            ³o¼Ë¤@¦æ³o·|¦bSheet2.Range("A:A")±½´y¥X¬Ûµ¥ªº¸ê¶Ü?
³o¬O§Q¥Î¤u§@ªí¨ç¼ÆMATCH§ä¨ì¹ïÀ³¦ì¸m¡A­Y¨S§ä¨ì¥¿½T¸ê®Æ·|¶Ç¦^¿ù»~´Ó
        4.)If IsNumeric(I) Then E.End(xlToRight).Offset(, 1) = Sheet2.Cells(I, "B")
            ¬°¤°»ò­n§@°µ  IsNumeric(I) ³o­Ó°Ê§@ ©O?
¦pªG Application.Match(E, Sheet2.Range("A:A"), 0)¯à§ä¨ì¹ïÀ³­È¡Aªí¥ÜI·J¬O­Óªø¾ã¼Æ¡A©Ò¥H¬O¼Æ­È¡A¨S§ä¨ì´NÀ³¬O¿ù»~´Ó¡A¥i¥ÎISERROR¨ç¼Æ´ú¸Õ¡C
±z¹ïEXCEL VBAªº¼ö§Õ¡A¤p§Ì¤Q¤À·q¨Ø¡A¤£¹L¦b¦¹´£¿ô±z¡AVBAÁÙ¬O­n¥ÑEXCEL°ò¥»¾Þ§@¤Î¥\¯àµÛ¤â¡A¤~¯à¨Æ¥b¥\­¿¡C
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 1# MRSA
  1. Sub Ex()
  2. Set d = CreateObject("Scripting.Dictionary")
  3. With Sheets(2)
  4. For Each a In .Range(.[A1], .[A65536].End(xlUp))
  5.    d(a.Value) = a.Offset(, 1)
  6. Next
  7. With Sheets(1)
  8. For Each a In .Range(.[A1], .[A65536].End(xlUp))
  9.    a.Offset(, 3) = d(a.Value)
  10. Next
  11. End With
  12. End With
  13. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

        ÀR«ä¦Û¦b : ªY½à§O¤H´N¬O²øÄY¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD