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

[µo°Ý] ¦³±ø¥óªº²Î­p

§A§âPrivate Sub Ex()
«e­±ªºPrivate ®³±¼
´N¥i¦b¤u§@¦C~¥¨¶°¤º¬Ý¨ì¥¦
«Ø¥ß¥¨¶°®É¹ï¸Ü¤è¶ô¦s©ñ¦ì¸m´N¿ï"­Ó¤H¥¨¶°¬¡­¶Ã¯"
³o¼Ë¶}¨C­ÓÀɮ׳£·|ÀH¤§¶}±Ò
¦s¼W¯q¶°¬O¥t¦s¡A¿ï"xla",¦s¦n«á¦b¼W¯q¶°¤¤¸ü¤J

TOP

¥»©«³Ì«á¥Ñ gctsai ©ó 2011-7-31 11:15 ½s¿è
§A§âPrivate Sub Ex()
«e­±ªºPrivate ®³±¼
´N¥i¦b¤u§@¦C~¥¨¶°¤º¬Ý¨ì¥¦
«Ø¥ß¥¨¶°®É¹ï¸Ü¤è¶ô¦s©ñ¦ì¸m´N¿ï" ...
oobird µoªí©ó 2011-7-31 09:02

ÁÂÁ¤j¤j,¥i¬O¦pªG§â"«e­±ªºPrivate ®³±¼"ªº¸Ü¨ºÁÙ¥i¥H¦Û°Ê§ó·s¶Ü?

¼W¯q¶°¤£ª¾¹D­n¿ï¨º¤@­Ó??

TOP

Privateªí¥Ü Sub µ{§Ç¥u¦b«Å§i¥¦¤§¼Ò²Õùتºµ{§Ç©Ò¨Ï¥Î¡C
»P¦Û°Ê§ó·s²@µLÃö«Y¡C

TOP

¤j¤j½Ð°Ý¤@¤U¬°¤°»ò§â"±ø¥ó"±q[A2]²¾¨ì[C2],µ²ªG§Ç¸¹[E2]´NÅܦ¨¤F°Ó«~«~¦W[G2]
text.rar (12.51 KB)

TOP

¦^´_ 24# gctsai
µ{§Ç¸Ì½Ð¥[¤W¬õ¦r³¡¤À
f = Application.Match(.[b1].Text, Sheets("¨Ó·½").Rows(1), 0) 'f: ¦b¨Ó·½¤¤´M§ä²Î­pªºÄæ¦ì
f = f - 2    '§AAÄæ±q²¾¨ìCÄæ ***** Rng.Offset·|§ïÅÜ
If Rng = .Range("A2") Then D(Rng.Offset(, f- 1).Value) = D(Rng.Offset(, f - 1).Value) + 1

TOP

¦^´_ 25# GBKEE

   ±q AÄæ²¾¨ìCÄæ­n¥[ f=f-2
   ¨º±qAÄæ²¾¨ìEÄæ¬O¤£¬O­n¥[ F=F-4
   ¤]´N¬O¦pªG²¾¦h¤ÖÄæ´N­n´î¦^¨Ó¶Ü??

TOP

½Ð°Ý¦U¦ì¤j¤j, ¦pªG­pºâ"¼Æ¶q"¥i§_¤£¬O§Q¥Îµ¥©ó¸¹(=) µ´¹ï­È {0,1,2...}, ¦Ó§ï¬° ¤j©ó/¤p©ó ¥i¥H¶Ü?
¤p¾Ç¥Í sony

TOP

¦^´_ 26# gctsai
­×§ï¦p¤U´N¥²¥h­pºâÄæ¦ì¤F
  1. Sub Ex()
  2.     Dim D As Object, Rng As Range, f As Variant
  3.     Set D = CreateObject("SCRIPTING.DICTIONARY") '³]¥ß¦r¨åª«¥ó
  4.     With Sheets("¨Ó·½")
  5.         Set Rng = .[c2]    '³]¥ßÀx¦s®æª«¥ó
  6.         f = Application.Match(Sheets("²Î­p").[b1].Text, .Rows(1), 0) 'f: ¦b¨Ó·½¤¤´M§ä²Î­pªºÄæ¦ì
  7.         If IsError(f) Then MsgBox "²Î­pªºÄæ¦ì¤£¦s¦b!!!": Exit Sub
  8.         Do While Rng <> ""        'Rngªº­È¬°ªÅ¥Õ®É¤£°õ¦æ Doªº°j°é
  9.            If Rng = Sheets("²Î­p").Range("A2") Then D(.Cells(Rng.Row, f).Value) = D(.Cells(Rng.Row, f).Value) + 1
  10.             '        .[A2] ->Sheets("²Î­p")[A2]      '¦r¨åª«¥ó(KEY)=ITEM + 1
  11.             Set Rng = Rng.Offset(1)  'Rng¤U²¾¤@¦C¦ì
  12.         Loop
  13.     End With
  14.     With Sheets("²Î­p").[B2:C2]
  15.         .Resize(.CurrentRegion.Rows.Count, 2) = ""
  16.         .Cells(1).Resize(D.Count) = Application.Transpose(D.KEYS)
  17.         .Cells(2).Resize(D.Count) = Application.Transpose(D.ITEMS)
  18.         .Resize(D.Count, 2).Sort Key1:=.Cells(1), Order1:=xlAscending, Header:=xlNo
  19.     End With
  20.     Set D = Nothing
  21.     Set Rng = Nothing
  22. End Sub
½Æ»s¥N½X

TOP

¤£¦n·N«ä,GBKEE¤j¤j,¥i¥H¸ÑÄÀ¤@¤U"SCRIPTING.DICTIONARY"ªº¥Îªk©O?³o­Ó§ÚÁÙ¨S¾Ç¹L,ÁÂÁÂ!
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

TOP

        ÀR«ä¦Û¦b : ¨Ã«D¦³¿ú¾{¬O§Ö¼Ö¡A°Ý¤ßµL·\¤ß³Ì¦w¡C
ªð¦^¦Cªí ¤W¤@¥DÃD