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

[µo°Ý] ­n¦p¦ó§âVBA©Ò²£¥Íªº ÀÉ®× ¦s¦¨ UTF-8½s½X?

[µo°Ý] ­n¦p¦ó§âVBA©Ò²£¥Íªº ÀÉ®× ¦s¦¨ UTF-8½s½X?

¥»©«³Ì«á¥Ñ CCL99 ©ó 2021-8-29 00:00 ½s¿è

§Ú¥ÎExcel ¨Ó¼gHTMLµ{¦¡¡AªB¤ÍÀ°§Ú¼g¥¨¶°§âExcelÂন¯Â¤å¦rÀɪº HTML¡A¥i¬O³o¯Â¤å¦rÀɪº½s½X¬OANSI µLªkÅý§Ú¥¿±`¨Ï¥Î¦h¦ì¤¸¦r¦p utf-8 ©Î utf-16¡C
¦b¥H¤Uªº¥¨¶°µ{¦¡½X¡A­n¼W¥[¤°»ò½X¤~¯à§â²£¥ÍªºÀɮצs¦¨utf-8½s½X?
  1. Public Sub WriteFile()

  2.    Const FileNum = 1
  3.    Dim FilePath As String
  4.    Dim R As Long
  5.    Dim C As Long
  6.    Dim Outline As String
  7.    Dim LastRow As Long
  8.    
  9.    FilePath = Replace(ThisWorkbook.FullName, ".xlsm", ".html")
  10.    
  11.    Open FilePath For Output As #FileNum
  12.    
  13.    R = 1
  14.    LastRow = Cells(Rows.Count, "B").End(xlUp).Row
  15.    
  16.    For R = 1 To LastRow
  17.       Outline = ""
  18.       For C = 1 To 21 ' B to U
  19.          Outline = Outline & Cells(R, C)
  20.       Next C
  21.       Print #FileNum, Trim(Outline)
  22.    Next R
  23.    
  24.    Close #FileNum
  25.    
  26.    MsgBox "File complete."

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

¨Ï¥ÎFileSystemObject
Word§e²{·¥­PªºÀRºA¤§¬ü¡AExcel®i²{·¥­Pªº°ÊºA¤§¬ü¡C

TOP

        ÀR«ä¦Û¦b : ¥Ç¿ù¥XÄb®¬¤ß¡A¤~¯à²M²bµL·Ð´o¡C
ªð¦^¦Cªí ¤W¤@¥DÃD