ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¥Î Numberformat ¦b¼Æ¦r«á¥[¤W¤å¦r(¤å¦r¥ÑÅܼƨú±o)

[µo°Ý] ¥Î Numberformat ¦b¼Æ¦r«á¥[¤W¤å¦r(¤å¦r¥ÑÅܼƨú±o)

½Ð°Ý¤j¤j­Ì:
§Úªº¥Øªº¬O¦b¼Æ¦r«á¥[¤W¤å¦r»¡©ú¡A¦ý¤£­n¼vÅTÀx¦s®æªº¼Æ¦r:
¨Ò¦p:   ¼Æ¦r­È¬O567¡A§Æ±æÀx¦s®æÅã¥Ü567 (20%)   ¡A³o(20%)¬O§Q¥Î¨ä¥LÅܼƨú±oªº­È¡C
¥Ø«e¬O§Q¥Înumberformat ¨Ó°µ¡A¼g­Ó¤pµ{¦¡ÅçÃÒ¤@¤U¡A«oµo²{°ÝÃD¦p¤U:
­YÅܼÆa="123" or a="---"®É¡Aµ{¦¡¥i¥¿½T°õ¦æ¡A¦ý­Y a="abc"´N¦³¿ù»~µLªk°õ¦æ¡A
¤j¤j¥i¥HÀ°¦£¬Ý¤@¤U°ÝÃD¥X¦b­þ¸Ì¶Ü?
  1. Sub Macro3()

  2. a = "abc"  'aÅܼƴN¬O¥Î¨Ó¨ú±o©ñ¦b¼Æ¦r«á­±ªº¤å¦r
  3. Selection.NumberFormat = "0.0" & a
  4.    
  5. End Sub
½Æ»s¥N½X

¦^´_ 1# swatt


¡@NumberFormat¡G¬°®É¶¡¤é´Á®æ¦¡¡A¬GµLªk¨Ï¥Î¥H¤U¦r¥À

¡@B¡BD¡BE¡BG¡BH¡BM¡BN¡BR¡BS¡BY
§Ú«Ü²Â,©Ò¥H§Ú«Ü¥Î¤ß
¡@§Ú¾ÇÃÀ¤£ºë,¦ý§Ú´÷¨Dª¾ÃÑ

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2014-10-10 05:31 ½s¿è

¦^´_ 1# swatt
  1. Option Explicit
  2. Sub Ex()
  3.     Dim a
  4.     'a = """abc"""  'aÅܼƴN¬O¥Î¨Ó¨ú±o©ñ¦b¼Æ¦r«á­±ªº¤å¦r
  5.     a = """GBK"""  '¦r¦ê¥[¤W"
  6.     Selection.NumberFormat = "0.0" & a
  7. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

RE: [¤w¸Ñ¨M]¥Î Numberformat ¦b¼Æ¦r«á¥[¤W¤å¦r(¤å¦r¥ÑÅܼƨú±o)

¦^´_ 3# GBKEE


·PÁ GBKEE  ¤j¤j, ­ì¨Ó¬O­n¦A¥[¤@²Õ¤Þ¸¹.
¥t¥~¤]¾Ç¨ì­n¦b¦r¦ê¸Ì¥[¤W"ªº¸Ü¡A»Ý­n¥Î¨â­Ó""¡A­×§ïcode¦p¤U:
  1. Sub Macro3()
  2. a = "abc"   'aÅܼƴN¬O¥Î¨Ó¨ú±o©ñ¦b¼Æ¦r«á­±ªº¤å¦r

  3. Selection.NumberFormat = "general" & """" & a & """"

  4. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¤Ñ¤W³Ì¬ü¬O¬P¬P¡A¤H¥Í³Ì¬ü¬O·Å±¡¡C
ªð¦^¦Cªí ¤W¤@¥DÃD