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

Àx¦s®æ¤º®e¤Î¯S®í²Å¸¹°ÝÃD

Àx¦s®æ¤º®e¤Î¯S®í²Å¸¹°ÝÃD

¦U¦ì¤j­ô¦n¡G
§Ú«È¤á¨t²Î¶×¥XexcelÀÉ®×¹J¨ì2°ÝÃD½Ð±Ð¡G
1.¦bexcel¤W©Ò¬Ý¨ìªº¸ê®Æ¥¿±`¡A¦ý¬O­Y¥t¦s¦¨TXTÀɶ}ÀY©Mµ²§À¦³¦h¥X "½Ð°Ý§ÚÀ³¦p¦ó²M°£¥¦
2.¤¤¶¡ªº"Ø"¦]»Ý­n§Ú·Q¥ÎAAA¨ú¥N¤S¸Ó¦p¦ó¡A­Y¥Î¤â°Ê¬d§ä¨ú¥N¨S°ÝÃD¦ý¬O­Y¥H¥¨¶°·|±N¥þ³¡ªºOµ¹¨ú¥N±¼¡C
¤W¦C°ÝÃD§Ú·Q¥Îvba³B¸Ì¬O§_¥i¦æ¡C test.rar (5.71 KB)
lionliu

"Ø"³o­Ó²Å¸¹ASCII¤£¬O216´N¬O248
°¾°¾VBAªºASCII¥u¯à¤ä´©0~128

ÅçÃҤ覡¦p¤U;
Sub VB_ASCII()
Dim x As Integer

Cells(1, 1) = "Item"
Cells(1, 2) = "Chr"
Cells(1, 3) = "Asc"
   
For x = 0 To 255
    Cells(x + 2, 1) = x
    Cells(x + 2, 2) = Chr(x)
    Cells(x + 2, 3) = Asc(Chr(x))
Next x
End Sub
­Y¬O§Ú¦^µª¡A¨Ï±zº¡·N¡A½Ð±zÅý§Úª¾¹D¡I                  
­Y¬O§Úªº¦^ÂСA±z¤´¦³¨ä¥L¨£¸Ñ¡A¤]½Ð±z¤£¶Þ«ü±Ð¡I

TOP

¸Ñªk¤G
Replace What:=range("B1"), Replacement:="aa"

B1Äæ¦ìHardcode"Ø"

¨þ¨þ¨þ~ ²Â¤è¦¡^^"
­Y¬O§Ú¦^µª¡A¨Ï±zº¡·N¡A½Ð±zÅý§Úª¾¹D¡I                  
­Y¬O§Úªº¦^ÂСA±z¤´¦³¨ä¥L¨£¸Ñ¡A¤]½Ð±z¤£¶Þ«ü±Ð¡I

TOP

¥H§A¨º­ÓÀɮצӨ¥
§AÀ³¸Ó¦CÁ|¤@¤U
¿é¥Xªº txtÀɤº®e, §A·Q­nªº¬Oªø¦¨¦ó¼Ò¼Ë

TOP

¥»©«³Ì«á¥Ñ lpk187 ©ó 2015-7-25 11:12 ½s¿è

¦^´_ 2# Min

"Ø"³o­Ó²Å¸¹VBA¬O¥i¥H¨ú±oªº
  1. Sub VB_ASCII()
  2. Dim x As Integer

  3. Cells(1, 1) = "Item"
  4. Cells(1, 2) = "Chr"
  5. Cells(1, 3) = "Asc"
  6.    
  7. For x = 0 To 255
  8.     Cells(x + 2, 1) = x
  9.     Cells(x + 2, 2) = ChrB(x)
  10.     Cells(x + 2, 3) = AscB(ChrB(x))
  11. Next x
  12. End Sub
½Æ»s¥N½X
VBA¤£¥uChr(n)¥i¥H¨Ï¥Î¡AÁÙ¦³ChrB(n)©MChrW(n)
  1. Public Sub test()
  2. Dim n As String
  3. Dim arr(1 To 256, 1 To 512)
  4. n = 0
  5. For i = 1 To 256
  6.     For j = 1 To 256
  7.         arr(j, i * 2 - 1) = ChrW(n)
  8.         arr(j, i * 2) = n
  9.         n = n + 1
  10.     Next
  11. Next
  12. Range("A1").Resize(256, 512) = arr
  13. End Sub
½Æ»s¥N½X
Chr ¨ç¼Æ
½Ð°Ñ¾\     ½d¨Ò     ¯S©Ê

¶Ç¦^¤@­Ó§t¦³»P«ü©wªº¦r¤¸½X¬ÛÃö¤§¦r¤¸ªº String¡C

»yªk

Chr(charcode)

charcode ¤Þ¼Æ¬O¤@­Ó¥Î¨ÓÃѧO¬Y¦r¤¸ªºLong¡C

½Ðª`·N

0 ¨ì 31 ¤§¶¡ªº¼Æ¦r»P¤@¯ë¡B«D¦C¦LªºASCII½X¬Û¦P¡A¨Ò¦p¡AChr(10) ·|¶Ç¦^´«¦æ¦r¤¸¡Ccharcode ªº¥¿±`½d³ò¬° 0-255¡CµM¦Ó¡A¦bDBCS¨t²Î¡Acharcode ªº¹ê»Ú½d³ò¬° -32768 ¨ì 65535¡C

ªþµù ChrB ¨ç¼Æ¬O¨Ï¥Î©ó§t¦³¦ì¤¸²Õ¸ê®Æªº String¡A¦Ó«D¶Ç¦^¤@­Ó¦r¤¸¡A¨ä¦³¥i¯à¬O¤@©Î¨â­Ó¦ì¤¸²Õ¡A¦Ó ChrB ³£¬O¶Ç¦^¤@­Ó¦ì¤¸²Õ¡CChrW ¨ç¼Æ«h¶Ç¦^¤@­Ó¥]§tUnicode ¦r¤¸ªºString¡A­Y¦b¤£¤ä´©Unicodeªº¥­¥x¤W¡A¨ä¥\¯à»PChr¨ç¼Æ¬Û¦P¡C

³Æµù   Visual Basic for the Macintosh ¤£¤ä´© Unicode ¦r¦ê¡C©Ò¥H¡AChrW(n) µLªk¶Ç¦^ n ­Ó¼Æ­È (½d³ò¬° 128 ¨ì 65,535) ªº©Ò¦³ Unicode ¦r¤¸¡A¦]¬°¥¦¦ì¦b Windows Àô¹Ò¤¤¡C¬Û¤Ï¦a¡AChrW(n) ·|¥ø¹Ï¬° n ¤j©ó 127 ªº Unicode ¼Æ­È¶i¦æ¡u³Ì¨Î±À´ú¡v¡C¦]¦¹¡A±z¤£¥i¥H¦b Macintosh Àô¹Ò¤¤¨Ï¥Î ChrW¡C

TOP

¦^´_ 5# lpk187


ChrW ½s½XÀ³¸Ó©M Ascii ¤£¤@¼Ë®@

TOP

¥»©«³Ì«á¥Ñ lpk187 ©ó 2015-7-25 11:43 ½s¿è

¦^´_ 6# bobomi
  1. Sub VB_ASCII()
  2. Dim x As Integer

  3.    
  4. For x = 0 To 255
  5.     Cells(x + 2, 1) = x
  6.     Cells(x + 2, 2) = Chr(x)
  7.     Cells(x + 2, 3) = ChrB(x)
  8.     Cells(x + 2, 4) = ChrW(x)
  9.     Cells(x + 2, 5) = AscW(ChrW(x))
  10. Next x
  11. End Sub
½Æ»s¥N½X
°£¤FChr¥u¯àÅã¥Ü0~127¥~½s½X¬Ý¤£¥X­þ¸Ì¤£¦P
ChrW(n) ¥u¬O¤£¯à¦b Macintosh Àô¹Ò¤¤¨Ï¥Î

TOP

¦^´_ 7# lpk187


§Ú«üªº¬O ChrW ©M Ascii ½s½X  
ChrW(224)  = à
Ascii (224) = ‡

TOP

¦^´_ 1# lionliu
1.¦bexcel¤W©Ò¬Ý¨ìªº¸ê®Æ¥¿±`¡A¦ý¬O­Y¥t¦s¦¨TXTÀɶ}ÀY©Mµ²§À¦³¦h¥X "½Ð°Ý§ÚÀ³¦p¦ó²M°£¥¦
½Ð°Ñ¦Ò³o¸Ì

2.¤¤¶¡ªº"Ø"¦]»Ý­n§Ú·Q¥ÎAAA¨ú¥N¤S¸Ó¦p¦ó¡A­Y¥Î¤â°Ê¬d§ä¨ú¥N¨S°ÝÃD¦ý¬O­Y¥H¥¨¶°·|±N¥þ³¡ªºOµ¹¨ú¥N±¼¡C
½Ð¤W¶Ç§A¥¨¶°ªºµ{¦¡½X!
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 8# bobomi

¤£¦n·N«ä¡A¦A¦¸¥´ÂZ¡I
§Ú­è¬d¤F·L³nªºASCIIÂX¥R½Xhttps://support.office.com/zh-tw/article/ASCII-%E5%AD%97%E5%85%83%E8%A1%A8-D13F58D3-7BCB-44A7-A4D5-972EE12E50E0?ui=zh-TW&rs=zh-TW&ad=TW#bm5
¤]¬O©M§APOªº¹Ï¤£¤@¼Ë¡I   ??
¦Ó¥B¬d¤F³\¦h±iÃö©óASCII½X¹Ï¤ù¡A«h¬O224³o­Ó½X«o¦³¦n´XºØ¡A©ó¬O§Úé¤F

TOP

        ÀR«ä¦Û¦b : ¯u¥¿ªº·R¤ß¡A¬O·ÓÅU¦n¦Û¤vªº³oÁû¤ß¡C
ªð¦^¦Cªí ¤W¤@¥DÃD