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

¦p¦ó¥ÎVBA¶×¤JCSVÀÉ?

¦p¦ó¥ÎVBA¶×¤JCSVÀÉ?

¥»©«³Ì«á¥Ñ am0251 ©ó 2011-9-6 16:26 ½s¿è

¦³°ª¤â¥i¥H±Ð§Ú¤@¤U¦p¦ó¥ÎVBA¶×¤JCSVÀÉ©O?ÁÙ¥i¥H¦Û¿ï¦C©M¤À¹jªº²Å¸¹,ÁÂÁÂ~~!
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

¦^´_ 13# toromru
°Ñ¦Ò³o¸Ì
http://forum.twbts.com/viewthread.php?tid=8522
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 9# GBKEE


    ±z¦n  ·Q¸ß°Ý ³o¼Ëª½±µ¶×¤J ¤¤¤å·|Åܦ¨¶Ã½X ·|¦³¸Ñ¶Ü?!

TOP

¦^´_ 11# toromru


    sub zz()
    sheets.copy
    activeworkbook.saveas "test"
    end sub
    'µo¦Û§Úªº¤p¦Ì¤â¾÷

TOP

¦^´_ 2# jimmyhk


    §A¦n ·Q¸ß°Ý ³o¼Ë¶}±Ò«á ¦³¿ìªk¦Û°Ê¥t¦s¨ì«ü©w¦ì§}ªºxlsÀɮ׶Ü?

    ¦p«ü©w¨ì "C:\test"  ³o¼Ë!!!

TOP

ÁÂÁ¦^ÂÐ,¥i¬O§Ú¥Î"¿ý»s"ªº¤èªk±o¨ì¤F¤U­±ªº¥¨¶°,¦³¨S¦³¿ìªk²³æªº¤èªk¼g¥X¨Ó©O?
  1. Sub csv()
  2. '
  3. ' csv Macro
  4. '

  5. '
  6.     With ActiveSheet.QueryTables.ADD(Connection:= _
  7.         "TEXT;E:\Excel\270710.csv", Destination:=Range("$A$1"))
  8.         .Name = "270710"
  9.         .FieldNames = True
  10.         .RowNumbers = False
  11.         .FillAdjacentFormulas = False
  12.         .PreserveFormatting = True
  13.         .RefreshOnFileOpen = False
  14.         .RefreshStyle = xlInsertDeleteCells
  15.         .SavePassword = False
  16.         .SaveData = True
  17.         .AdjustColumnWidth = True
  18.         .RefreshPeriod = 0
  19.         .TextFilePromptOnRefresh = False
  20.         .TextFilePlatform = 950
  21.         .TextFileStartRow = 1
  22.         .TextFileParseType = xlDelimited
  23.         .TextFileTextQualifier = xlTextQualifierDoubleQuote
  24.         .TextFileConsecutiveDelimiter = True
  25.         .TextFileTabDelimiter = True
  26.         .TextFileSemicolonDelimiter = False
  27.         .TextFileCommaDelimiter = True
  28.         .TextFileSpaceDelimiter = True
  29.         .TextFileColumnDataTypes = Array(1, 1, 9, 9, 1, 1, 1)
  30.         .TextFileTrailingMinusNumbers = True
  31.         .Refresh BackgroundQuery:=False
  32.     End With
  33. End Sub
½Æ»s¥N½X
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

¦^´_ 8# am0251
  1. Sub Ex()
  2.     Dim ¶×¥XÀÉ As String, ¶×¤JÀÉ As Workbook
  3.     Set ¶×¤JÀÉ = ActiveWorkbook
  4.     'Set ¶×¤JÀÉ = Workbooks("TEST.XLS")
  5.     ¶×¥XÀÉ = "D:\TEST\270710.CSV"
  6.     With Workbooks.Open(¶×¥XÀÉ).Sheets(1)
  7.         ¶×¤JÀÉ.Sheets(1).Range("A:A") = .Range("B:B").Value
  8.         ¶×¤JÀÉ.Sheets(1).Range("B:B") = .Range("E:E").Value
  9.         .Parent.Close False    'Ãö³¬ ¶×¥XÀÉ
  10.     End With
  11. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ am0251 ©ó 2011-9-29 13:25 ½s¿è

ÁÂÁ¦^ÂÐ,¥i¯à¬O§Úªí¹Fªº¤£¬O«Ü¦n,³o­ÓÀɮ׬O§Ú¥Î"¸ê®Æ - ±q¤å¦rÀÉ"ªº¤èªk¶×¤Jªº,"SHEET1"¤À¹j²Å¸¹¬O¥Î¤F,"³rÂI" ©M "ªÅ®æ","SHEET2"´N¬O§Ú­nªº¥Øªº¤F,¥u¦³²Ä2©M²Ä5¦æ¶×¤J¤F,§Ú¥u¬O¨S¿ìªk¼g¥X¨Ó........ Inport CSV.rar (122.98 KB)
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

¦^´_ 6# am0251
  1. Sub Ex()
  2.     Dim ¶×¥XÀÉ As String, ¶×¤JÀÉ As Workbook
  3.     Set ¶×¤JÀÉ = ActiveWorkbook     'Set ¶×¤JÀÉ = Workbooks("TEST.XLS")
  4.     ¶×¥XÀÉ = "D:\TEST\270710.CSV"
  5.     With Workbooks.Open(¶×¥XÀÉ).Sheets(1)
  6.         .Range("A5").Resize(5).EntireRow.Copy ¶×¤JÀÉ.Sheets(1).[A1]
  7.         '.Range("A5").Resize(5) ->5¦C  ,  EntireRow ¾ã¦C½d³ò
  8.           .Parent.Close False    'Ãö³¬ ¶×¥XÀÉ
  9.     End With
  10. End Sub
½Æ»s¥N½X

TOP

270710.rar (18.22 KB)
ÁÂÁ¨â¦ìªº¦^ÂÐ,¥u¬Oluhpro¤j¤jªº¼gªk¦³ÂIÃø,¤pªº¨S¬ÝÀ´¦h¤Ö,¨ä¹ê§Ú¥u¬O·Q"¶×¤J"CSV"ÀÉ,¦Ó¤£¬O"¶}±Ò"¦]¬°§Ú­n¿ï¾Ü"¤À¹j²Å¸¹",¦p"TABÁä" "¤À¸¹" "³rÂI" "ªÅ®æ" µ¥¤èªk,ÁÙ¦³´N¬O¶×¤Jªº¦æ¼Æ,¦p³o­ÓÀÉ®×,§Úªº¤À¹j²Å¸¹¬O "³rÂI" ©M "ªÅ®æ",¶×¤Jªº¦æ¼Æ¥u¬O²Ä2¦æ©M²Ä5¦æ,¸Ó«ç»ò¼g©O?
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

        ÀR«ä¦Û¦b : «H¤ß¡B¼Ý¤O¡B«i®ð¤TªÌ¨ã³Æ¡A«h¤Ñ¤U¨S¦³°µ¤£¦¨ªº¨Æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD