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

½Ð°Ý¦p¦ó±N¿ï¨úªºtxtÀɤº®e¶×¤J«ü©wÀx¦s®æ©O?

½Ð°Ý¦p¦ó±N¿ï¨úªºtxtÀɤº®e¶×¤J«ü©wÀx¦s®æ©O?

[ª©¥DºÞ²z¯d¨¥]
  • Hsieh(2013-4-23 23:33): ½Ð§âtxtÀÉ»P§Æ±æ±o¨ìµ²ªGÀɮתþ¤W

¥»©«³Ì«á¥Ñ Mindyj ©ó 2013-4-23 14:48 ½s¿è

½Ð±Ð¦U¦ì«e½ú¡A§Ú¥Ø«eª¦¤å§ä¨ì±NtxtÀÉ¥Hexcel¼Ò¦¡¶}±Ò

¥i¬O©|¥¼§ä¨ì¥ô¦ó¥i¥Hª½±µÅª¨ú©M½Æ»stxtÀɤº®e¶K¤W¦Ü«ü©wsheet1Àx¦s®æA6¡A¨Ã¥B©T©wÀx¦s®æ¤j¤p

¥i¥H½Ð±Ð¦U¦ì«e¨ì¸Ó¦p¦ó°õ¦æ³o­Ó³¡¥÷¶Ü? ÁÂÁÂ

[attach]14754

ª¦¤åªº¤º®e¦p¤U
Dim fileToOpen
     fileToOpen = Application.GetOpenFilename(FileFilter:="Text Files (*.txt),*.txt", Title:="please select the file")
     If fileToOpen <> False Then
        Workbooks.OpenText Filename:=fileToOpen _
         , origin:=950, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
         xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=True, Semicolon:=False, _
         Comma:=False, Space:=True, Other:=False, FieldInfo:=Array(Array(1, 1), _
         Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1)), _
         TrailingMinusNumbers:=True
     End If

Import txt.zip (16.38 KB)

import

Import txt.zip (16.38 KB)

¦^´_  luhpro
...
¤£¹L²{¦b©µ¦ù¥X¥t¤@­Ó°ÝÃD¡A­n«ç»ò¼Ë¤~¯àÅý¥ô¦óÀɮ׳£Âରhtmlªº¤è¦¡¶K¨ìexcel¤W­±©O?
Mindyj µoªí©ó 2013-6-6 07:27

¬Ý¤£À´§Aªº·N«ä.

Âରhtmlªº¤è¦¡¶K¨ìexcel?
¦b Excel ¥»¨­ªº¨¤«×¤W,
¥¦¤W­±ªº¨C­ÓÀx¦s®æ³£¥i¥H¦³¦Û¤vªº®æ¦¡,
¦ý¦L¶H¤¤¦ü¥G¨Ã¨S¦³©Ò¿×ªºhtml®æ¦¡,
ÁÙ¬O»¡§A·Q­n§â Excel ·íÂsÄý¾¹¥Î¶Ü?

­Y¬O¨º©Î³\§A¥i¥H¥ý·s¼W¤@­Óªí³æ,
¦A´¡¤J¤@­ÓWebBrowserª«¥ó¨Ó¹ê²{.
(¦Ü©ó«ç»ò¹ê²{§Ú¤]¤£·|,¥i¯à­n½Ð¨ä¥L¤H¦^µª¤F)

TOP

¦^´_ 8# luhpro

ÁÂÁÂluhpro¡A§Ú¾Ç²ß¨ì¹ê¥Îªº¤@½Ò¡C

¤£¹L²{¦b©µ¦ù¥X¥t¤@­Ó°ÝÃD¡A­n«ç»ò¼Ë¤~¯àÅý¥ô¦óÀɮ׳£Âରhtmlªº¤è¦¡¶K¨ìexcel¤W­±©O?

TOP

½Ð°Ýª©¥D¡B¦pªG¿ï¾ÜªºÀɮ׫¬ºA¤£­­¨î¡B¨Ã±N¶K¤WÄæ¦ì©T©w¦bA1¸Ó«ç»ò­×§ï©O?
§Ú¸Õ¹L±NÀÉ®×Ãþ«¬§ï¬°all¡A¥i¬O ...
Mindyj µoªí©ó 2013-6-3 11:20


§Aªº 02. ¦æµ{¦¡­n§ï¦¨ :
fs = Application.GetOpenFilename("All Files (*.*), *.*")
§Y¥i.

¦b Windows ¨t²Î¤¤ *.all  ¨Ã¤£¬O "Àɮ׫¬ºA¤£­­¨î" ªº·N«ä,
¦Ó¬O¦p :
1.all
efaew.all
cfg.all
³oÃþ °ÆÀɦW¬° all ªºÀÉ®×,
­Y·Q¦C¥X "Àɮ׫¬ºA¤£­­¨î" ªºÀÉ®×,
À³¸Ó­n¥Î  *.*   ¨Ó§@¬°¿z¿ï±ø¥óªº¤å¦rªí¥Ü.

TOP

½Ð°Ýª©¥D¡B¦pªG¿ï¾ÜªºÀɮ׫¬ºA¤£­­¨î¡B¨Ã±N¶K¤WÄæ¦ì©T©w¦bA1¸Ó«ç»ò­×§ï©O?
§Ú¸Õ¹L±NÀÉ®×Ãþ«¬§ï¬°all¡A¥i¬O¨Ã¤£¾A¥Î¡C
  1. Dim A As Range
  2. fs = Application.GetOpenFilename("Files (*.all), *.all")
  3. Set A = Application.InputBox("Choose the file position", , "$A$1", , , , , 8)
  4. Open fs For Input As #1
  5. Do While Not EOF(1)    ' Loop to the end of the file?
  6.     Line Input #1, TextLine
  7.     A.Offset(i, 0) = TextLine
  8.     i = i + 1
  9. Loop
  10. Close #1
½Æ»s¥N½X
¦^´_ 5# Hsieh

TOP

·PÁª©¥D¡B´ú¸Õ¦¨¥\!!!   

TOP

¦^´_ 4# Mindyj
  1. Sub import()
  2. Dim A As Range
  3. fs = Application.GetOpenFilename("Text Files (*.txt), *.txt")
  4. Set A = Application.InputBox("¿ï¾Ü¤å¦rÀÉ­n©ñ¸mªº¦ì¸m", , "$A$1", , , , , 8)
  5. Open fs For Input As #1
  6. Do While Not EOF(1)    ' °õ¦æ°j°éª½¨ìÀɧÀ¬°¤î¡C
  7.     Line Input #1, TextLine
  8.     A.Offset(i, 0) = TextLine
  9.     i = i + 1
  10. Loop
  11. Close #1
  12. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¤p¤k¤£¤~¡A¤£ª¾¦p¦ó§ó§ï¦¹½X¡A°ÝÃD¦p¤U
°ÝÃD1. txtÀÉ·|ÀHµÛ¨Ï¥ÎªÌ©Ò¿ï¾ÜªºÀɮצӦ³©Ò¤£¦P¡A©Ò¥H¤~·|¨Ï¥Îmacro¶i¦æÀɮ׿ï¨úªº°Ê§@
°ÝÃD2. ¨Ï¥ÎªÌ¦b¿ï¨úÀɮ׫á¡Amacro·|±N¿ï¨úÀɮפ§¤º®e½Æ»s¨Ã¶K¤W¦Ü«ü©wsheet»P«ü©wÀx¦s®æ¤¤

TOP

¦^´_ 2# Mindyj
  1. Sub ex()
  2. fs = ThisWorkbook.Path & "\import.txt"
  3. Open fs For Input As #1
  4. i = 6
  5. Do While Not EOF(1)    ' °õ¦æ°j°éª½¨ìÀɧÀ¬°¤î¡C
  6.     Line Input #1, TextLine
  7.     Cells(i, 1) = TextLine
  8.     i = i + 1
  9. Loop
  10. Close #1
  11. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¸É¤WtxtÀÉ»P§Æ±æµ²ªG

Import.zip (20.25 KB)
¦^´_ 1# Mindyj

TOP

        ÀR«ä¦Û¦b : ¬°¤H³B¥@­n¤p¤ß²Ó¤ß¡A¦ý¤£­n¡u¤p¤ß²´¡v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD