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

match ·j´M¤£¦P¤u§@ªí¥i¥H«ü©wÅܼƶÜ?

¦^´_ 38# EGBT
401298E-45 ¨ì 3.402823E38 ¬O¬ì¾Ç°O¸¹,½ÐGOOGLE ¬d¬Ý¤F¸Ñ
Dim i, y, x As Single
'i, y ¨S«ü©w³£¬O As Variant,V½Ð¦Û¦æ¬d¬Ý VBA ªº»¡©ú
i, y             µ{¦¡¥i¥H±µ¨ü¶Ç¦^¿ù»~­È,
x As Single ¥²¶·¬O¶Ç¦^¼Æ¦r,µ{¦¡¤£±µ¨ü¿ù»~­È.
  1. Application.Match("A1", Range("C1:C14"), -1)
½Æ»s¥N½X
½Ð¬Ý40¼Óªºµ{¦¡½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 41# GBKEE


    Match¦^¶Ç¬O¼Æ¦r(¦C)¨S¿ù..¦ý§Úªºµ{¦¡½X¦p¤U

Match¥´ 1 or -1 ³£¤£¦æ...¥´0´N¥i¥H ¦ý§ä¤£¨ì¬Û¦Pªº¼Æ­È¥L·|§ä"¤p©ó"¼Æ­Èªº¡A«o¤£¬O§ä"µ¥©ó"¼Æ­Èªº

ªþÀÉ®×
  1. Sub test()
  2. Dim x As Single
  3. x = Application.Match(Range("A1"), Range("B:B"), -1)
  4. Sheets("Sheet1").Range("F1") = x
  5. End Sub
½Æ»s¥N½X

ttt.rar (12.74 KB)

ªþÀÉ®×

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2015-9-24 15:37 ½s¿è

¦^´_ 42# EGBT
x As Single (¬O°w¹ï·¸¦ì ­×§ïªº«¬ºA )
Match §ä¤£¨ì¶Ç¦^¿ù»~­È,»Pxªº«¬ºA¤£¹ï,¬Gµ{¦¡¦³«¬ºA¤£²Å¦Xªº»~­È.
©Ò¥H¥²¶·¬O Dim x As Variant

Match¥´ 1 or -1 ³£¤£¦æ...¥´0´N¥i¥H   
À³¸Ó¬O Match¥´ 0 or -1 ³£¤£¦æ...¥´1´N¥i¥H
  1. Match_type    ¬O­Ó¼Æ¦r¡A¨ä­È¦³¤TºØ¥i¯à¡G-1¡B0 ©Î 1¡C¥Î¥H«ü©w Microsoft Excel ¦p¦ó±q lookup_array ¸Ì´M§ä lookup_value¡C
  2. ¦pªG match_type ¬O 1¡A«h MATCH ¨ç¼Æ·|§ä¨ìµ¥©ó©Î¶È¦¸©ó lookup_value ªº­È¡CLookup_array ¥²¶·¥H»¼¼W¦¸§Ç±Æ¦C¡G...-2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE¡C
  3. ¦pªG match_type ¬O 0¡A«h MATCH ¨ç¼Æ·|§ä²Ä¤@­Ó§¹¥þµ¥©ó lookup_value ªº¤ñ¸û­È¡CLookup_array ¥i¥H¨Ì¥ô·N¦¸§Ç±Æ¦C¡C
  4. ¦pªG match_type ¬O -1¡A«h MATCH ¨ç¼Æ·|§ä¨ìµ¥©ó©Î¤j©ó lookup_value ªº³Ì¤p­È¡CLookup_array ¥²¶·¥H»¼´î¦¸§Ç±Æ§Ç¡GTRUE, FALSE, Z-A, ...2, 1, 0, -1, -2, ...¡A¥H¦¹Ãþ±À¡C
  5. ¦pªG match_type ¤Þ¼Æ³Q¬Ù²¤¡A«h°²³]¨ä­È¬° 1¡C
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 43# GBKEE


    ¦pªG match_type ¬O -1¡A«h MATCH ¨ç¼Æ·|§ä¨ìµ¥©ó©Î¤j©ó lookup_value ªº³Ì¤p­È¡CLookup_array ¥²¶·¥H»¼´î¦¸§Ç±Æ§Ç¡GTRUE, FALSE, Z-A, ...2, 1, 0, -1, -2, ...¡A¥H¦¹Ãþ±À¡C

ÃöÁä´N¬O¦b...­n»¼´î±Æ§Ç...§Ú¬ÝMatch»¡©ú

¥u¦³¥´¨ìmatch_type ¬° 1 , Lookup_array ¥²¶·¥H»¼¼W±Æ¦C...

§Ú·Q½Ð°Ý¤@¤U...°²¦p»¡ match_type = -1 (§ä»¼´î)

¼Æ­È¡G2015/1/1

°}¦C¡G
2015/1/12
2014/12/20
2014/12/10
2014/12/5

¥H match_type = -1 ·|§ä¨ì 2014/12/20

§Ú¯à±±¨î¦b 5¤é¤º¶Ü? ¤]´N¬O»¡ §ä2014/12/25 ~ 2014/12/29 °²¦p¨S¦³´N¬O§ä¤£¨ì

TOP

¦^´_  citizen0923
GBKEE µoªí©ó 2015-9-24 05:43



ÁÂÁÂG¤j~ §Ú¸Õ¥X¨Ó¤F!!
Private Sub CommandButton1_Click()
Dim sheetx As String
sheetx = Cells(1, 1)
Cells(4, 1) = Application.Match(Range("A3"), Sheets(sheetx).Range("A1:A10"), 0)
End Sub
§ï¦¨³o¼Ë~´N¥i¥H¦Û¥Ñªº§ó§ï·j´Mªº¤À­¶¦WºÙ¤F~ ¦A¦¸·PÁ±z~!!ÁÂÁÂ

TOP

¦^´_ 44# EGBT

match_type ¬O 1¡A«h MATCH ¨ç¼Æ·|
§ä¨ìµ¥©ó©Î¶È¦¸©ó lookup_value ªº­È¡CLookup_array ¥²¶·¥H»¼¼W¦¸§Ç±Æ¦C¡G...-2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE¡C
match_type ¬O -1¡A«h MATCH ¨ç¼Æ·|
§ä¨ìµ¥©ó©Î¤j©ó lookup_value ªº³Ì¤p­È¡CLookup_array ¥²¶·¥H»¼´î¦¸§Ç±Æ§Ç¡GTRUE, FALSE, Z-A, ...2, 1, 0, -1, -2, ...¡A¥H¦¹Ãþ±À¡C
¦pªG match_type ¤Þ¼Æ³Q¬Ù²¤¡A«h°²³]¨ä­È¬° 1
  1. Sub test()
  2.     Dim x As Variant, Mdate As Date
  3.     x = Application.Match(Range("A1"), Range("B:B"), -1)
  4.     If IsNumeric(x) Then
  5.        Mdate = Range("b" & x)
  6.        x = Range("A1") - Mdate
  7.        If x >= 0 And x <= 5 Then MsgBox Mdate
  8.     End If
  9. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 46# GBKEE


    ¤j¤j¨D±Ï..¬°¤°»ò·|¥X²{"¸ü¤JDLL®Éµo¥Í¿ù»~"

¤u¨ã -> ³]©w¤Þ¥Î¶µ¥Ø³£¦³¥´¤Ä

§ÚÀɮ׳£¦³³Æ¥÷¡A¥u¬O§Ú·Qª¾¹D¬°¤°»ò·|¥X²{"¸ü¤JDLL®Éµo¥Í¿ù»~"...

¦ý¤£¬O¦]¬°µ{¦¡½X¤~¾É­P"¸ü¤JDLL®Éµo¥Í¿ù»~"ªºµo¥Í¡A¦]¬°§Ú¸Õ¹L«Ü¦¸.....

¤Þ¥Î¶µ¥Ø.png (7.33 KB)

³£¦³¥´¤Ä

¤Þ¥Î¶µ¥Ø.png

TOP

¦^´_ 47# EGBT
    Ãö³¬ÀÉ®×(­n¦sÀÉ).¦A¶}±Ò¬Ý¬Ý
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 48# GBKEE


    °ò¥»¤W¥´¶}¥X²{"¸ü¤JDLL®Éµo¥Í¿ù»~"

³o®É­Ô¤£ºÞ¦sÀÉ»P§_¡Aµ{¦¡³£¤w¸g®ø¥¢¤£¨£¤F

TOP

¦^´_ 48# GBKEE


    ½Ð°ÝGBKEE¤j¤j

Ãö©óCombobox¤U©Ô¬O¿ï³æªºList

²M³æ¤º®e¯à¤£¯à±qµ{¦¡½X¥´¦n¹w³]¡A¦Ó¤£¬O±qÀx¦s®æ?

TOP

        ÀR«ä¦Û¦b : °ß¨ä´L­«¦Û¤vªº¤H¡A¤~§ó«i©óÁY¤p¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD