- ©«¤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 ©ó 2023-12-1 15:14 ½s¿è
ÁÂÁ½׾Â,ÁÂÁ¦U¦ì«e½ú
«á¾ÇÂǦ¹©«½m²ß¦r¦ê¤Ï¦V»P°}¦C,¾Ç²ß¤è®×¦p¤U,½Ð¦U¦ì«e½ú«ü±Ð
°õ¦æ«e:
°õ¦æµ²ªG:
Option Explicit
Sub TEST()
Dim Brr, S, i&, V1, Ve
'¡ô«Å§iÅܼÆ
Brr = Range([B1], [B65536].End(xlUp))
'¡ô¥OBrrÅܼƬO ¥H«ü©wªºÀx¦s®æ½d³òȪº¤Gºû°}¦C
For i = 2 To UBound(Brr)
'¡ô³]¶¶°j°é!i±q2¨ìBrr°}¦CÁa¦V³Ì¤j¯Á¤Þ¦C¸¹
S = Split(Trim(Brr(i, 1)) & "-", "-")
'¡ô¥OSÅܼƬO¤À³Î¦r¦êªº¤@ºû°}¦C
V1 = Val(StrReverse(Mid(Val("1" & StrReverse(S(0))), 2)))
'¡ô¥OV1ÅܼƬO±N0¯Á¤Þ¸¹°}¦CȦr¦ê¤ÏÂà«á,¦b«e¤è³s±µ¦r¦ê"1"¦¨¬°·s¦r¦ê,
'¦A¦¹·s¦r¦êÂର¼ÆÈ,¨ú²Ä2¦r¤§«áªº¦r,±µµÛ±N¦¹¦r¦ê¤ÏÂà¦^¨Ó,³Ì«áÂର¼ÆÈ
Ve = Val(S(UBound(S) - 1))
'¡ô¥OVeÅܼƬO˼ƲÄ2Ó°}¦CÈÂର¼ÆÈ
If V1 > 390 Or UBound(S) - 1 = 0 Then Brr(i - 1, 1) = "": GoTo i01
'¡ô¦pªGÂŦâ°Ï°ì¼ÆȤj©ó390 ©Î Brr(i, 1)¦r¦ê¸Ì¨S¦³"-",
'´N¥O°}¦C©ñµ²ªGªº°}¦CȲM°£,¸õ¨ì¼Ð¥Üªº¦ì¸mÄ~Äò°õ¦æ
Brr(i - 1, 1) = Switch((Ve <= 180) * (Ve > 90), 2, Ve <= 90, 1)
'¡ô¥O°}¦C©ñµ²ªGªº°}¦Cȼg¤J¥¿½TÈ
i01: Next
[D2].Resize(UBound(Brr) - 1) = Brr
'¡ô¥O[D2]Àx¦s®æÂX®i©Ò»Ý½d³òÀx¦s®æÈ¥H Brr°}¦Cȱa¤J
End Sub |
|