|
ハチ さん
こんにちは。
読み込みまでは出来ています。
現在下記のようなコードで読み込んでいます。
Sub Macro2()
Dim n1 As Long
Dim vFileNames As Variant
Dim iFileNo As String
Dim rCell As Range
Dim rCellStart As Range
Dim TextLine As String
vFileNames = Application.GetOpenFilename("CSVファイル (*.csv),*.CSV", , "取込みファイル選択", , True)
If Not IsArray(vFileNames) Then
Exit Sub
End If
Set rCellStart = Nothing
For n1 = 1 To UBound(vFileNames)
iFileNo = FreeFile
Open vFileNames(n1) For Input As #iFileNo
Line Input #iFileNo, TextLine
Close #iFileNo
Set rCell = Range("A65536").End(xlUp).Offset(1)
If rCell.Offset(-1).Value = "" Then
Set rCell = rCell.Offset(-1)
End If
If rCellStart Is Nothing Then
Set rCellStart = rCell
End If
rCell.Value = TextLine
Next
'データ区切り
Range(rCellStart, rCell).TextToColumns Destination:=rCellStart, DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
:=Array(Array(1, 1), Array(2, 2), Array(3, 2), Array(4, 1), Array(5, 2), Array(6, 2), _
Array(7, 1), Array(8, 1), Array(9, 1), Array(10, 1)), TrailingMinusNumbers:=True
Cells.Rows.AutoFit
Range("A1").Select
End Sub
これで3つ目の削除とか出来るんですか??
|
|