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

[µo°Ý] °Ñ¦Ò¥H¤Uºô­¶¡ASTRCONV ¦b VBA ¦p¦óªí¥Ü¡AÁÂÁÂ

[µo°Ý] °Ñ¦Ò¥H¤Uºô­¶¡ASTRCONV ¦b VBA ¦p¦óªí¥Ü¡AÁÂÁÂ

¥»©«³Ì«á¥Ñ wufonna ©ó 2013-9-13 15:48 ½s¿è

http://www.cnblogs.com/xuqingfeng/archive/2013/03/21/About-Strings-StrConv.html

    a1 = Strings.StrConv("书¼Öう반", VbStrConv.TraditionalChinese, 0x0404);    // a1 = "?¼Ö??"
    a2 = Strings.StrConv("书¼Öう반", VbStrConv.SimplifiedChinese, 0x0404);     // a2 = "????"

    b1 = Strings.StrConv("书¼Öう반", VbStrConv.TraditionalChinese, 0x0804);    // b1 = "®Ñ¼Öう?"
    b2 = Strings.StrConv("书¼Öう반", VbStrConv.SimplifiedChinese, 0x0804);     // b2 = "书乐う?"

    c1 = Strings.StrConv("书¼Öう반", VbStrConv.TraditionalChinese, 0x0412);    // c1 = "?¼Öう반"
    c2 = Strings.StrConv("书¼Öう반", VbStrConv.SimplifiedChinese, 0x0412);     // c2 = "??う반"

    d1 = Strings.StrConv("书¼Öう반", VbStrConv.TraditionalChinese, 0x0009);    // d1 = "®Ñ¼Öう반"
    d2 = Strings.StrConv("书¼Öう반", VbStrConv.SimplifiedChinese, 0x0009);     // d2 = "书乐う반"

ÁÂÁÂ

½Ð°Ý¬O°Ñ¼Æ¿ù¤F¡AÁÙ¬O¤èªk¿ù¤F
ÁÙ¬O¦³ strconv api
ÁÂÁÂ
Sub test()
Dim a As String
With ¤u§@ªí1
             .Cells.EntireColumn.AutoFit
  a = StrConv(.Cells(1, 2), vbTraditionalChinese, 1028)
  Debug.Print a
  a = StrConv(.Cells(1, 2), VbSimplifiedChinese, 1028)
  Debug.Print a
  a = StrConv(.Cells(1, 2), vbTraditionalChinese, 2052)
  Debug.Print a
  a = StrConv(.Cells(1, 2), VbSimplifiedChinese, 2052)
  Debug.Print a
  a = StrConv(.Cells(1, 2), vbTraditionalChinese, 1042)
  Debug.Print a
  a = StrConv(.Cells(1, 2), VbSimplifiedChinese, 1042)
  Debug.Print a
  a = StrConv(.Cells(1, 2), vbTraditionalChinese, 9)
  Debug.Print a
  a = StrConv(.Cells(1, 2), VbSimplifiedChinese, 9)
  Debug.Print a
    End With
   

End Sub

test.rar (12.85 KB)

test.rar (12.85 KB)

TOP

¦^´_ 3# wufonna
Vba¨S³o°Ñ¼Æ­È   vbTraditionalChinese

·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

½Ð°Ý G ¤j
Sub test()
Dim a As String


With ¤u§@ªí1
  .Cells.EntireColumn.AutoFit
  a = StrConv(.Cells(1, 2), vbKatakana)
  Debug.Print a
    End With
End Sub

¬°¤°»ò¤£¯à¥Î

»¡©úÀɤ¤
LCID ¿ï¶µªº¡C¦pªG»P¨t²ÎLocaleID¤£¦P¡A«h¬°LocaleID¡]¨t²ÎLocaleID¬°¯Ê¬Ù­È¡C¡^
LCID ¦p¦ó¥Î

vbKatakana** 16** ±N¦r¦ê¤¤¥­°²¦W¦r¤¸Âন¤ù°²¦W¦r¤¸¡C
¤¤ªº**¬O¤°»ò

http://www.cnblogs.com/xuqingfeng/archive/2013/03/21/About-Strings-StrConv.html
¤¤»¡
¦b .NET Àô¹Ò¤¤, Microsoft.VisualBasic.dll ¸Ì¤]¦³´£¨Ñ Strings.StrConv ¤èªk
vba ¥i¥H¤Þ¥Î¶Ü
ÁÂÁÂ

TOP

¦^´_ 5# wufonna
StrConv(.Cells(1, 2), vbKatakana)¤£¯à¥Î: ½Ð¦A¬Ý 4#¹Ï¦¡ ¾A¥Î¤é¤å¦a°Ï
LCID ¦p¦ó¥Î   °Ñ¦Ò³o¸Ì
NET Àô¹Ò¤¤, Microsoft.VisualBasic.dll ¸Ì¤]¦³´£¨Ñ Strings.StrConv ¤èªk
vba ¥i¥H¤Þ¥Î¶Ü? : ½Ð¦A ¸Ô¬Ý VBA ªºStrConv ªº»¡©ú
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

ÁÂÁÂ G¤j
§Ú¦A¸Õ¸Õ ^_^

TOP

        ÀR«ä¦Û¦b : ¤H¨ÆªºÁ}Ãø»PµZ¿i¡A´N¬O¤@ºØ¦ÒÅç¡C
ªð¦^¦Cªí ¤W¤@¥DÃD