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

[µo°Ý] EXCELÂà TXTÀÉ, ¦p¦ó¦Û°Ê·s¼WÂù¤Þ¸¹?

[µo°Ý] EXCELÂà TXTÀÉ, ¦p¦ó¦Û°Ê·s¼WÂù¤Þ¸¹?

¥»©«³Ì«á¥Ñ mistery ©ó 2019-6-6 19:12 ½s¿è

'ÂàÀɮɱNÀx¦s®æ³B²z¼W¥[Âù¤Þ¸¹

Cells(i, j) = Chr(34) & CStr(Cells(i, j))

ActiveWorkbook.SaveAs Filename:= spath & "\Q.txt", FileFormat:=xlCSV, CreateBackup:=False

EXCE¢Ú¤º¡GLUCKY08   LUCKY09    (¤À¦C¦b¨â­ÓÀx¦s®æ)  ¡@¡@  
Âà¨ìTXTÀÉ«á¡G """LUCKY08" ,  """LUCKY09"      (¥ªÃä¤T­ÓÂù¤Þ¸¹,¥kÃä¤@­ÓÂù¤Þ¸¹)

«ç»ò°µ´N¬OµLªk"¥¿±`"¥X²{¥ª¥k¦U¤@­ÓÂù¤Þ¸¹ ???  
  
  ½Ð¤j®v¸Ñ´b

Âù¤Þ¸¹.png (11.53 KB)

Âù¤Þ¸¹.png

¥»©«³Ì«á¥Ñ n7822123 ©ó 2019-6-6 23:08 ½s¿è

¦^´_ 1# mistery


¦s¦¨txt´N¤£­n¥ÎCSV¦sÀɤF¡A§ï¦sÀɮ榡§a¡A¸Õ¸Õ¬Ý

ActiveWorkbook.SaveAs Filename:=spath & "\Q.txt", FileFormat:=xlTextPrinter, CreateBackup:=False
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

¦]¬°­n¨D®æ¦¡¬°  ¥H Âù¤Þ¸¹  ®Ø¦í ­È   ¨Ã¥Î  ³r¸¹  ¹j¶}¡@
¤§©Ò¥H¤£¥Î FileFormat:=xlTextPrinter   ¬O¦]¬°´N·|Åܦ¨¥Î  ªÅ®æ  ¹j¶}

¤£¹L~~ÁÙ¬O«D±`ÁÂÁ¡A§ÚÁÙ¬O·|¦A·Q·Q

TOP

¦^´_ 3# mistery


  ¥ÎReplace ³B²z¦r¦ê¡A§âªÅ®æÅܦ¨³r¸¹¡A¦]¬°§A¨Sµ¹ÀɮסA©Ò¥H§Ú¤]¥u¯àµ¹«Øij
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP



¸Õ¸Õ
Sub test()
    Dim f As Integer, temp(1 To 3)
    f = FreeFile
    Open "c:\test.txt" For Output As #f
    For i = 1 To 5
        For j = 1 To 3
              temp(j) = Chr(34) & Cells(i, j) & Chr(34)
        Next j
        Print #f, Join(temp, ",")
    Next i
    Close #f
End Sub

TOP

        ÀR«ä¦Û¦b : ¦³Ä@©ñ¦b¤ß¸Ì¡A¨S¦³¨­Åé¤O¦æ¡A¥¿¦p¯Ñ¥Ð¤£¼½ºØ¡A¬Ò¬OªÅ¹L¦]½t¡C
ªð¦^¦Cªí ¤W¤@¥DÃD