pºâ¤£«½Æ¸ê®Æ¥X²{¦¸¼Æ [¤w¸Ñ¨M]
- ©«¤l
- 42
- ¥DÃD
- 9
- ºëµØ
- 0
- ¿n¤À
- 64
- ÂI¦W
- 0
- §@·~¨t²Î
- WINDOW7
- ³nÅ骩¥»
- OFFICE2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-9-3
- ³Ì«áµn¿ý
- 2013-6-10
|
pºâ¤£«½Æ¸ê®Æ¥X²{¦¸¼Æ [¤w¸Ñ¨M]
¥»©«³Ì«á¥Ñ loyyee ©ó 2011-9-17 00:06 ½s¿è
½Ð°Ýn¦p¦ó¥Î¥¨¶°pºâ¤U¦C¤£«½Æ¸ê®Æ¥X²{¦¸¼Æ?
A B
1 0001 A1
2 0001 A2
3 0001 A2
4 0001 A3
5 0002 A1
6 0002 B1
7 0002 B1
8 0002 B1
±o¨ìµ²ªG¡G0001¥X²{¤£«½Æ¦¸¼Æ=3¡B0002¥X²{¤£«½Æ¦¸¼Æ=2 |
|
|
|
|
|
|
- ©«¤l
- 231
- ¥DÃD
- 55
- ºëµØ
- 0
- ¿n¤À
- 293
- ÂI¦W
- 0
- §@·~¨t²Î
- winxp
- ³nÅ骩¥»
- office2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- KEELUNG
- µù¥U®É¶¡
- 2010-7-24
- ³Ì«áµn¿ý
- 2018-8-28
|
¥»©«³Ì«á¥Ñ dechiuan999 ©ó 2011-9-4 19:41 ½s¿è
§A¦n¡G
½Ð°Ý§Aªºpºâ°ò¦¬°¦ó©O¡H
¦pªG¥H0002¥X²{¤£«ÂЦ¸¼Æ¬°=2®É¡A
·Q¥²¬O¥HA¤ÎB¦X¨Ö¬°KEYÈ¡A
0002A1 ¤@¦¸
0002B1 ¤T¦¸¡A¤£«ÂЦ¸¼Æ¬°¤G
¨º0001À³¬°1¦¸¤~¦X²z¡C
0001¦p¦ópºâ¤£«ÂЦ¸¼Æ¬°=3©O¡H
¦pªG¤Wz±À²z¥¿½T®É¡A½Ð¸Õ¸Õ¤U¦C»yªk
Sub aa()
'½Ð¥ý¥Ñ¤u¨ã¦C¤Þ¥ÎMicrosoft Scripting Rungtime
Dim mDic As Scripting.Dictionary
Dim mSht As Worksheet
Dim mRng As Range, mRng1 As Range
Dim E As Range
Dim mTmp, mVal
Dim i%
Set mDic = CreateObject("scripting.dictionary")
Set mSht = Worksheets(1)
With mSht
Set mRng = .Range("a1", Range("a" & .Rows.Count).End(xlUp))
For Each E In mRng
If Not E.Value = Empty Then
If Not mDic.Exists(E.Value & "_" & E.Offset(, 1).Value) Then
mDic(E.Value & "_" & E.Offset(, 1).Value) = 1
Else
mDic(E.Value & "_" & E.Offset(, 1).Value) = mDic(E.Value & "_" & E.Offset(, 1).Value) + 1
End If
End If
Next
For Each E In mRng
E.Offset(, 3).Value = E.Value & "_" & E.Offset(, 1).Value
Next
mKey = mDic.Keys
For i = LBound(mKey) To UBound(mKey)
mVal = mDic(mKey(i))
If mVal > 1 Then
Set mRng1 = mSht.Columns(4).Find(what:=mKey(i), lookat:=xlWhole, searchorder:=xlByRows, searchdirection:=xlNext)
If Not mRng1 Is Nothing Then
mRng1.Offset(, -1).Value = mVal - 1
End If
End If
Next
.Columns(4).ClearContents
End With
End Sub |
|
|
|
|
|
|
- ©«¤l
- 42
- ¥DÃD
- 9
- ºëµØ
- 0
- ¿n¤À
- 64
- ÂI¦W
- 0
- §@·~¨t²Î
- WINDOW7
- ³nÅ骩¥»
- OFFICE2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-9-3
- ³Ì«áµn¿ý
- 2013-6-10
|
¦^´_ 2# dechiuan999
±z¦n¡A©êºp¨S»¡²M·¡¡AA.BÄæ¦ì¬On¦X¨Ö°_¨Ó¬Ý¤~¹ï¡C
0001 ¥X²{:A1.A2.A3=3¦¸ |
|
|
|
|
|
|
- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 253
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-11-22
|
- Sub nn()
- Set d = CreateObject("Scripting.Dictionary")
- For Each a In Range([A1], [A1].End(xlDown))
- If IsEmpty(d(a.Value)) Then
- d(a.Value) = a.Offset(, 1)
- ElseIf IsError(Application.Match(a.Offset(, 1), Split(d(a.Value), ","), 0)) Then
- d(a.Value) = d(a.Value) & "," & a.Offset(, 1)
- End If
- Next
- For Each ky In d.keys
- d(ky) = Array(ky, UBound(Split(d(ky), ",")) + 1)
- Next
- [C1].Resize(d.Count, 2) = Application.Transpose(Application.Transpose(d.items))
- End Sub
½Æ»s¥N½X ¦^´_ 3# loyyee |
|
¾Ç®üµL²P_¤£®¢¤U°Ý
|
|
|
|
|
- ©«¤l
- 42
- ¥DÃD
- 9
- ºëµØ
- 0
- ¿n¤À
- 64
- ÂI¦W
- 0
- §@·~¨t²Î
- WINDOW7
- ³nÅ骩¥»
- OFFICE2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-9-3
- ³Ì«áµn¿ý
- 2013-6-10
|
¦^´_ 4# Hsieh
·PÁÂHsiehµ{¦¡¥i¥H¥Î¤F¡C
¦A½Ð°Ý¤@¤U¦p¦ó¦b F3Àx¦s®æ¥[¤Jµù¸ÑÅã¥Üpºâ¥X¨Óªºµ²ªG¡G
µù¸Ñ¤º®e¦p¤U~
0001 ¦¸¼Æ=3
0002 ¦¸¼Æ=2
µ§¼Æ¡G2 (¦]¥X²{¡G0001¡B0002¤Gµ§¸ê®Æ) |
|
|
|
|
|
|
- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 253
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-11-22
|
¦^´_ 5# loyyee - Sub nn()
- Set d = CreateObject("Scripting.Dictionary")
- For Each a In Range([A1], [A1].End(xlDown))
- If IsEmpty(d(a.Value)) Then
- d(a.Value) = a.Offset(, 1)
- ElseIf IsError(Application.Match(a.Offset(, 1), Split(d(a.Value), ","), 0)) Then
- d(a.Value) = d(a.Value) & "," & a.Offset(, 1)
- End If
- Next
- For Each ky In d.keys
- d(ky) = Array(ky, UBound(Split(d(ky), ",")) + 1)
- If mystr = "" Then
- mystr = Join(d(ky), "¦¸¼Æ=")
- Else
- mystr = mystr & Chr(10) & Join(d(ky), "¦¸¼Æ=")
- End If
- Next
- mystr = mystr & Chr(10) & "µ§¼Æ= " & d.Count & "(¦]¥X²{ : " & Join(d.keys, "¡B") & Application.Text(d.Count, "[DBNum1]") & "µ§¸ê®Æ)"
- [C:E] = ""
- [C1].Resize(d.Count, 2) = Application.Transpose(Application.Transpose(d.items))
- [C1].Offset(d.Count, 3) = mystr
- End Sub
½Æ»s¥N½X |
|
¾Ç®üµL²P_¤£®¢¤U°Ý
|
|
|
|
|
- ©«¤l
- 42
- ¥DÃD
- 9
- ºëµØ
- 0
- ¿n¤À
- 64
- ÂI¦W
- 0
- §@·~¨t²Î
- WINDOW7
- ³nÅ骩¥»
- OFFICE2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-9-3
- ³Ì«áµn¿ý
- 2013-6-10
|
|
|
|
|
|
|