- ©«¤l
- 1447
- ¥DÃD
- 40
- ºëµØ
- 0
- ¿n¤À
- 1471
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Excel 2010 & 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2020-7-15
- ³Ì«áµn¿ý
- 2024-11-29
|
¥»©«³Ì«á¥Ñ Andy2483 ©ó 2022-8-11 11:51 ½s¿è
¦^´_ 1# t8899
¤£Åã¥Ü¾ã¼Æ«á¤èªº "." ¨Ãºû«ù¦UÓ¦ì¼Æ¹ï»ô
1.«öTEST«ö¶s
2.°õ¦æ«á¥Ñ©óÅܤƫܤp! »Ý¬d¬Ý¦³©³¦âªºÀx¦s®æ
3.ÁקK¼vÅT¨ä¥¦®æ¦¡ªºÀx¦s®æ! ®æ¦¡³]©w¬°¥H¤U¨âºØªº¤~·|³QÅܧó®æ¦¡ ©Î ¥æ´«Åܧó®æ¦¡
A. #,##0.??;[¬õ¦â]-##,#?0.??
B. #,###_._0_0;[¬õ¦â]-#,###_._0_0
PS:®æ¦¡³]©wªº§e²{µ²ªG³Ì¦n»PìȬۦP!§_«h¦³¥ØµøªºÀ³¥Î»~®t!
20220811.zip (16.58 KB)
Option Explicit
Sub TEST()
Dim Ar As Range, a As Range, NF1, NF2
NF1 = "#,###_._0_0;[¬õ¦â]-#,###_._0_0"
NF2 = "#,##0.??;[¬õ¦â]-##,#?0.??"
Set Ar = Cells
For Each a In Ar.SpecialCells(2)
If a.NumberFormatLocal = NF1 Or a.NumberFormatLocal = NF2 Then
If a Like "*#" = True And a Like "*.*" = False Then
a.NumberFormatLocal = NF1
ElseIf a Like "*#.#*" Then
a.NumberFormatLocal = NF2
End If
End If
Next
End Sub |
|