- ©«¤l
- 45
- ¥DÃD
- 10
- ºëµØ
- 0
- ¿n¤À
- 59
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office 2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2014-2-6
- ³Ì«áµn¿ý
- 2019-6-22
|
¦^´_ 3# hcm19522
·PÁÂhcm19522«e½ú´£¨Ñ¸Ñµª,¤Q¤Àȱo¬ã¨s.
¤p§Ì¥»·Q¥t¶}·s¥DÃD´£°Ý,¦]·Q´£ªº°ÝÃD¬°VBA,À³¤£Äݤ@¯ë°Ïªº½d³ò¤º.
¦ý¦]°ÝÃD¬O·½©ó¦¹¥DÃD,¬G¥Î¦^¤å¤è¦¡,
Y¦³¤£§´ÁٽФ£§[§iª¾,¤p§Ì¤@©w§ï¶i,¤Q¤À·PÁÂ.
¤p§Ì¬Ý¨ì¦¹¥DÃD«á¦³¸ÕµÛ¥ÎªO¤W«e½úªºµ{¦¡½X¾Õ¦Ûקï,¸Õ¹Ï¼g¥XÃþ¦üµ²ªG.
ªþ¤WÀɮפε{¦¡½X,§Æ±æ¯à°÷¦³©ÒÀ°§U.¦³¤£·í³B½Ð¤£§[§iª¾,¤p§Ì¤@©w§ï¶i.
¦]¥\¤O¤Ó®t,קï¥X¨Óªºµ{¦¡½X«D±`¤¾ªø,¦Ó¥B¦³¤@Ó°ÝÃD,´N¬On¥ý±Nì©l¸ê®Æ¥Îexcelªº¤º«Ø¥\¯à±Æ§Ç¹L«á,µ²ªG¤~¥i¥¿±`Åã¥Ü....
Y¦³«e½úÄ@·N©âªÅ«üÂI§ó²¼äªº¼gªk,¤p§Ì·P¿E¤£ºÉ.- '¦¹µ{¦¡½Xקï¦Û³Â»¶®a±Ú°Q½×°Ïexcel°ª¤â²a´£³¡ªL«e½ú©Ò¼g,«D§Ú¦Û³Ð.
- '°Q½×°Ïºô§}:http://forum.twbts.com/index.php
- Sub test1()
- Dim arr, arr1, arr2, arr3, arr4, brr(1 To 4), k, Ar
- arr = Range("a2:b" & Cells(Rows.Count, 1).End(xlUp).Row)
- '¥¨¶°¿ý»sexcelªº±q¤p¨ì¤j±Æ§Ç¥\¯à(±Æ§ÇBÄæ)
- ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Clear
- ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=Range("B2"), _
- SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
- With ActiveWorkbook.Worksheets("Sheet1").Sort
- .SetRange Range("A2:B" & Cells(Rows.Count, 1).End(xlUp).Row)
- .Header = xlNo
- .MatchCase = False
- .Orientation = xlTopToBottom
- .SortMethod = xlPinYin
- .Apply
- End With
- '¿ý»sµ²§ô
- 'pºâ¨CÓ¬ì¥Ø¥X²{ªº¦¸¼Æ
- Set myD = CreateObject("scripting.dictionary")
- For k = 1 To UBound(arr)
- T = arr(k, 1)
- myD(T) = myD(T) + 1
- Next k
- ReDim arr1(1 To myD("^¤å"))
- ReDim arr2(1 To myD("°ê¤å"))
- ReDim arr3(1 To myD("¼Æ¾Ç"))
- ReDim arr4(1 To myD("¦ÛµM"))
- For i = 1 To UBound(arr)
- If arr(i, 1) = "^¤å" Then N = 1
- If arr(i, 1) = "°ê¤å" Then N = 2
- If arr(i, 1) = "¼Æ¾Ç" Then N = 3
- If arr(i, 1) = "¦ÛµM" Then N = 4
- brr(N) = brr(N) + 1
- If N = 1 Then arr1(brr(1)) = arr(i, 2)
- If N = 2 Then arr2(brr(2)) = arr(i, 2)
- If N = 3 Then arr3(brr(3)) = arr(i, 2)
- If N = 4 Then arr4(brr(4)) = arr(i, 2)
- 101:
- Next i
- [e2] = Join(arr1, "¡B")
- [e3] = Join(arr2, "¡B")
- [e4] = Join(arr3, "¡B")
- [e5] = Join(arr4, "¡B")
- End Sub
½Æ»s¥N½X
20161025-°}¦C-±Æ§Ç¬ì¥Ø¤À¼Æ.zip (12.78 KB)
¤p§Ì¤£ª¾¦¹ºØµo°Ý¤è¦¡¥H¤Î¥ÎªO¤W«e½úµ{¦¡½Xקï¥h¦^µªªO¤Í°ÝÃDªº¤è¦¡¬O§_«ê·í,
Y¦³¤£§´·í³B½Ð¤£§[«ü¥¿»P§iª¾,¤p§Ì¤@©w§ï¶i,¤Q¤À·PÁÂ. |
|