- ©«¤l
- 1446
- ¥DÃD
- 40
- ºëµØ
- 0
- ¿n¤À
- 1470
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Excel 2010 & 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2020-7-15
- ³Ì«áµn¿ý
- 2024-10-21
|
¥»©«³Ì«á¥Ñ Andy2483 ©ó 2022-9-19 10:07 ½s¿è
¦^´_ 1# jackyliu
ÁÂÁ«e½úµoªí¦¹¥DÃD
VBA¤è¦¡¨Ñ°Ñ¦Ò
«á¾Ç¤µ¤Ñ±Ëªñ¨D»·
1.½m²ßÅܼƦW°Ñ¼Æ¤Æ
2.§ó¿Ëªñ¦r¨å
«á¾Ç«Ü·Q¾Ç²ß¤£¤@¼Ëªº§Þ¥©! ¥ýÁÂÁ¦U¦ì«e½úÀ°q¥¿¿ù»~¨Ã¦A«ü¾É!- Option Explicit
- Sub Äæ¦ì¤º®e¥]§tABC¤å¦r§PÂ_()
- 'BÄæ¿é¤J®É¼Æ,CÄæ§e²{²Ö¥[«á®É¶¡
- 'AÄæ¥]§tABC,¦bDÄæ="¤Wñ"
- 'AÄæ¥]§tADEM,¦bDÄæ="¤Uñ"
- 'AÄ椣¥]§tABC¥B¤£¥]§tADEM,¦bDÄæ="²¤¹L"
- 'AÄæ¥]§tABC¥B¥]§tADEM,¦bDÄæ="¤Wñ+¤Uñ"
- Dim Arr, i, Y, Z(1 To 3)
- Set Y = CreateObject("Scripting.Dictionary")
- Y = Array("¤Wñ", "¤Uñ", "²¤¹L")
- Arr = [A2].CurrentRegion
- For i = 2 To UBound(Arr)
- Z(1) = Arr(i, 2) / 24 + Arr(i - 1, 3)
- Z(2) = InStr(Arr(i, 1), "ABC")
- Z(3) = InStr(Arr(i, 1), "ADEM")
- Arr(i, 3) = IIf(Arr(i, 2), Z(1), "")
- If Z(2) <> 0 And Z(3) <> 0 Then
- Arr(i, 4) = Y(0) & "+" & Y(1)
- ElseIf Z(2) = 0 And Z(3) = 0 Then
- Arr(i, 4) = Y(2)
- ElseIf Z(3) = 0 Then
- Arr(i, 4) = Y(0)
- Else
- Arr(i, 4) = Y(1)
- End If
- Next
- [A2].Resize(UBound(Arr), UBound(Arr, 2)) = Arr
- End Sub
½Æ»s¥N½X |
|