"Vlookup" and "Match" in VBA
- ©«¤l
- 65
- ¥DÃD
- 11
- ºëµØ
- 0
- ¿n¤À
- 83
- ÂI¦W
- 0
- §@·~¨t²Î
- Window 7
- ³nÅ骩¥»
- 2007
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2010-5-4
- ³Ì«áµn¿ý
- 2012-5-21
|
ÁÂÁ«ü±Ð~~!!·Pı¥\¤O´£ª@¤F¤£¤p!! |
|
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X
|
|
|
|
|
- ©«¤l
- 65
- ¥DÃD
- 11
- ºëµØ
- 0
- ¿n¤À
- 83
- ÂI¦W
- 0
- §@·~¨t²Î
- Window 7
- ³nÅ骩¥»
- 2007
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2010-5-4
- ³Ì«áµn¿ý
- 2012-5-21
|
¥»©«³Ì«á¥Ñ am0251 ©ó 2011-6-23 15:03 ½s¿è
¦pªG§Ú·Q§âÅܼÆ"y"ªºÈµ¥©ó,§ÚªºUserFrom ¤ºªº Calendar ªºÈ,¥i¬O§Ú¼g¤F"y = Calendar1.Value"¥X¨Óªºµ²ªG¬O"1/¤»¤ë/2011 ",§ÚªºÄݩʤw¸g§ï"^¤å(²µu)"ªº¤F,n¦bþ¸Ì¥i¥H§ï¦¨"1-Jun-11"©O?
¦]¬°§Ún§â"x" "y"Åܦ¨Cells(x,y)ªºÚµ¼Ð,"x"´N¬OItemName,"y"´N¬O¤é´Á,¦pB2="1-Jun-11"; C2="2-Jun-11"............¦³¥i¯à°µªº¨ì¶Ü? |
|
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X
|
|
|
|
|
- ©«¤l
- 1572
- ¥DÃD
- 16
- ºëµØ
- 2
- ¿n¤À
- 1521
- ÂI¦W
- 0
- §@·~¨t²Î
- xp
- ³nÅ骩¥»
- office 2003
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2016-1-13
|
y = Format(Calendar1.Value, "d-mmm-yy")
MsgBox y |
|
|
|
|
|
|
- ©«¤l
- 65
- ¥DÃD
- 11
- ºëµØ
- 0
- ¿n¤À
- 83
- ÂI¦W
- 0
- §@·~¨t²Î
- Window 7
- ³nÅ骩¥»
- 2007
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2010-5-4
- ³Ì«áµn¿ý
- 2012-5-21
|
¤£¦n·N«ä......§Ú¤S¥¢±Ñ¤F......
Book1.rar (22.21 KB)
|
|
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X
|
|
|
|
|
- ©«¤l
- 1572
- ¥DÃD
- 16
- ºëµØ
- 2
- ¿n¤À
- 1521
- ÂI¦W
- 0
- §@·~¨t²Î
- xp
- ³nÅ骩¥»
- office 2003
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2016-1-13
|
Cells(x, y)¸Ì±ªºx,y³£¥²¶·¬O¼Æ¦r
¤£¯à¬O¤é´Á¡C |
|
|
|
|
|
|
- ©«¤l
- 65
- ¥DÃD
- 11
- ºëµØ
- 0
- ¿n¤À
- 83
- ÂI¦W
- 0
- §@·~¨t²Î
- Window 7
- ³nÅ骩¥»
- 2007
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2010-5-4
- ³Ì«áµn¿ý
- 2012-5-21
|
¥»©«³Ì«á¥Ñ am0251 ©ó 2011-6-24 15:36 ½s¿è
ÁÂÁ«üÂI,¤w§ï¦n¤F,¥i¬O.......ÁÙ¬O¤£¦æ.........
Book1.rar (23.12 KB)
|
-
-
Book1.rar
(23.12 KB)
|
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X
|
|
|
|
|
- ©«¤l
- 76
- ¥DÃD
- 19
- ºëµØ
- 0
- ¿n¤À
- 145
- ÂI¦W
- 0
- §@·~¨t²Î
- win xp
- ³nÅ骩¥»
- OFFICE 2003
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2010-5-24
- ³Ì«áµn¿ý
- 2014-6-24
|
è¦n¦³§Q¥Î¨ì~~·PÁÂoobird
Private Sub CommandButton1_Click()
Dim x As Integer, y As Integer, z As Integer, ItemName As String
z = 6
Do While Range("N" & z).Value <> ""
ItemNam = Sheet3.Range("N" & z).Value
Sheet3.Range("S" & z).Value = Application.VLookup(ItemNam, Sheet4.[A1:B29], 2, 0)
z = z + 1
Loop
End Sub |
|
|
|
|
|
|
- ©«¤l
- 65
- ¥DÃD
- 11
- ºëµØ
- 0
- ¿n¤À
- 83
- ÂI¦W
- 0
- §@·~¨t²Î
- Window 7
- ³nÅ骩¥»
- 2007
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2010-5-4
- ³Ì«áµn¿ý
- 2012-5-21
|
¥»©«³Ì«á¥Ñ am0251 ©ó 2011-6-25 14:39 ½s¿è
¤£¦n·N«ä,¤pªº¨S¬ÝÀ´....³o¬O§Úªºµ{§Ç- Private Sub Start_Click()
- Dim x As Integer, y As Integer, z As Integer, S1 As Integer, S2 As Integer, myRowCount As Integer
- Dim ShipDate As Date
- Dim ItemName As String
- z = 2
- myRowCount = Range("A1").CurrentRegion.Rows.Count
- ItemName = Worksheets("Sheet1").Range("A" & z).Value
- ShipDate = Format(Calendar1.Value, "d-mmm-yy")
- For i = 2 To myRowCount
- x = Application.Match(ItemName, Sheet2.["A1", "A" & myRowCount], 0)
- y = Application.Match(ShipDate, Sheet2.[B1:AF1], 0)
- S1 = Workbooks("Book1").Worksheets("Sheet1").Cells(z, 2).Value
- S2 = Workbooks("Book1").Worksheets("Sheet2").Cells(x, y).Value
- S2 = S2 + S1
- z = z + 1
- Next i
- Unload Me
- MsgBox "Done"
- End Sub
½Æ»s¥N½X |
|
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X
|
|
|
|
|