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

[µo°Ý] ¦p¦ó©îÀÉ©Mµ²¦X·s´¡¤Jªº«ü©w¤å¦rÀÉ

¦^´_ 20# luke
  1. Option Explicit
  2. Sub §RÀɦW()
  3.     Dim xi As Integer
  4.     With Workbooks("TEST21OK.CSV").Sheets(1)
  5.         .[A:A].Replace "[*]", "=1/0"
  6.         .Range("A:A").SpecialCells(xlCellTypeFormulas, xlErrors).Name = "xx"
  7.         .Range("xx").EntireRow.Delete
  8.         .Range("a:a").SpecialCells(xlCellTypeBlanks).Name = "xx"
  9.         For xi = 1 To .Range("xx").Areas.Count - 1
  10.             .Range("xx").Areas(xi).Cells(1).EntireRow.Delete
  11.          Next
  12.     End With
  13. End Sub
½Æ»s¥N½X

TOP

¦^´_ 21# GBKEE

ª©¤j¦n

§Ú·Q±NÀÉ®×°µ©îÀɧY¶}±ÒTEST21.csv¤å¦rÀÉ,
§ä¨ì[*ÀɦW.csv*]©Mµ²§Àµü[*div*],
±N¨âªÌ¤§¶¡ªºÀɮפº®e¨ú¥X«á,
«ö¶¶§Ç¦s¦¨Unicode¤å¦rÀɮ榡.

¨Ò¦p: ¦¹ÀÉTEST21.csv£®¼Æ¶q¦³5­ÓÀÉ®×,
¨Ì¾Ú¨C­ÓÀÉ®×¹ïÀ³¤º®eÂà¦s¦¨5­Ó·sÀÉ.
A01.csv
BB-1.csv
CC0001.csv
DD1.csv
E00001.csv
(PS: [*ÀɦW.csv*]©Mµ²§Àµü[*div*]¤£­n¦s¤J·sÀÉ)

TEST21D.rar (98.88 KB)

TOP

¦^´_ 22# luke
  1. Option Explicit
  2. Sub ©îÀÉ()
  3.     Dim Ar(), MyPath As String, E As Range, Rng As Range, xlFileName As String
  4.     Dim ArFile(), Msg As String
  5.      'CurDir  ¶Ç¦^¤@­Ó Variant (String)¡A¥Î¨Ó¥Nªí¥Ø«eªº¸ô®|¡C
  6.     MyPath = CurDir & "\"  '¦Û¦æ­×§ï¥¿½T¸ô®|¡C
  7.     If Dir(MyPath & "*.csv") <> "" Then Kill MyPath & "*.csv"   '§R°£¥Ø«eªº¸ô®|¤Uªº.cgs ÀÉ®×
  8.     With Workbooks("TEST21.csv").Sheets(1)
  9.         Ar = .Range("a:a").Value
  10.         .Range("a:a").Replace "[*.*]", "=1/0"                                       '[*.*] ´À¥N¬°¿ù»~­È
  11.         .Range("a:a").SpecialCells(xlCellTypeFormulas, xlErrors).Name = "xx"        '©w¸q¦WºÙ: ¿ù»~­ÈªºÀx¦s®æ
  12.         .Range("a:a").Value = Ar
  13.         For Each E In .[XX]
  14.             Set Rng = E.CurrentRegion
  15.             Set Rng = .Range(E.Cells(2, 1), Rng.Cells(Rng.Rows.Count, Rng.Columns.Count))
  16.             xlFileName = Replace(Replace(E, "[*", ""), "*]", "")
  17.             With Workbooks.Add(1)
  18.                 Rng.Copy .Sheets(1).[a1]
  19.                 .SaveAs MyPath & xlFileName, xlUnicodeText
  20.                 .Close 0
  21.             End With
  22.          Next
  23.          .Parent.Close 0
  24.     End With
  25. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ luke ©ó 2012-6-9 23:21 ½s¿è

¦^´_ 23# GBKEE

´ú¸Õsub ²ÕÀÉ()

ÁÂÁª©¤j

TOP

        ÀR«ä¦Û¦b : ¬Ý§O¤H¤£¶¶²´¡A¬O¦Û¤v­×¾i¤£°÷¡C
ªð¦^¦Cªí ¤W¤@¥DÃD