M
morry
Can someone tell me how to copy data from a csv file to a differen
sheet in a new excel workbook? My csv file is a log and there ar
61,000 rows of data that increases every day so I can't set a specifi
range. The way I have it coded just converts it to an excel file the
copies it to the new workbook as a new page then leaves the old cop
open. I am trying to open this file into a new workbook, close it, an
format the new excel sheet.
Here is what i have so far:
Workbooks.OpenText Filename:= _
"\\WRG4156\iLinkProe\batch\mxload.Proe.dat", Origin:= _
xlWindows, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Other:=True
OtherChar:="|", FieldInfo:=Array(Array(1, 1), _
Array(2, 1))
'Sheets("mxload.proe").Copy Before:=Workbooks("Import Pro
Log.xls").Sheets(1)
'Worksheets("mxload.proe").Hide
Rows("1:2").Select
Selection.Insert Shift:=xlDown
Range("A1").Select
ActiveCell.FormulaR1C1 = "Part Number"
Range("B1").Select
ActiveCell.FormulaR1C1 = "Letter State"
Range("C1").Select
ActiveCell.FormulaR1C1 = "Type"
Range("D1").Select
ActiveCell.FormulaR1C1 = "Description"
Range("F1").Select
ActiveCell.FormulaR1C1 = "Sheet Size"
Range("G1").Select
ActiveCell.FormulaR1C1 = "Release Level"
Range("H1").Select
ActiveCell.FormulaR1C1 = "Sheet Count"
Range("I1").Select
ActiveCell.FormulaR1C1 = "Engineer"
Range("J1").Select
ActiveCell.FormulaR1C1 = "Decision Number"
Range("K1").Select
ActiveCell.FormulaR1C1 = "Date Modified"
Range("L1").Select
ActiveCell.FormulaR1C1 = "Unknown"
Range("M1").Select
ActiveCell.FormulaR1C1 = "Part Name"
Range("N1").Select
ActiveCell.FormulaR1C1 = "Cad Group"
Rows("1:1").Select
Selection.Font.Bold = True
With Selection
.HorizontalAlignment = xlCenter
End With
Columns("A:N").Select
Columns("A:N").EntireColumn.AutoFit
Columns("C:F").Select
Selection.EntireColumn.Hidden = True
Columns("H:I").Select
Selection.EntireColumn.Hidden = True
Columns("K:M").Select
Selection.EntireColumn.Hidden = True
Range("A1").Select
If anyone can help with this, that would be great.
Thank you,
Morr
sheet in a new excel workbook? My csv file is a log and there ar
61,000 rows of data that increases every day so I can't set a specifi
range. The way I have it coded just converts it to an excel file the
copies it to the new workbook as a new page then leaves the old cop
open. I am trying to open this file into a new workbook, close it, an
format the new excel sheet.
Here is what i have so far:
Workbooks.OpenText Filename:= _
"\\WRG4156\iLinkProe\batch\mxload.Proe.dat", Origin:= _
xlWindows, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Other:=True
OtherChar:="|", FieldInfo:=Array(Array(1, 1), _
Array(2, 1))
'Sheets("mxload.proe").Copy Before:=Workbooks("Import Pro
Log.xls").Sheets(1)
'Worksheets("mxload.proe").Hide
Rows("1:2").Select
Selection.Insert Shift:=xlDown
Range("A1").Select
ActiveCell.FormulaR1C1 = "Part Number"
Range("B1").Select
ActiveCell.FormulaR1C1 = "Letter State"
Range("C1").Select
ActiveCell.FormulaR1C1 = "Type"
Range("D1").Select
ActiveCell.FormulaR1C1 = "Description"
Range("F1").Select
ActiveCell.FormulaR1C1 = "Sheet Size"
Range("G1").Select
ActiveCell.FormulaR1C1 = "Release Level"
Range("H1").Select
ActiveCell.FormulaR1C1 = "Sheet Count"
Range("I1").Select
ActiveCell.FormulaR1C1 = "Engineer"
Range("J1").Select
ActiveCell.FormulaR1C1 = "Decision Number"
Range("K1").Select
ActiveCell.FormulaR1C1 = "Date Modified"
Range("L1").Select
ActiveCell.FormulaR1C1 = "Unknown"
Range("M1").Select
ActiveCell.FormulaR1C1 = "Part Name"
Range("N1").Select
ActiveCell.FormulaR1C1 = "Cad Group"
Rows("1:1").Select
Selection.Font.Bold = True
With Selection
.HorizontalAlignment = xlCenter
End With
Columns("A:N").Select
Columns("A:N").EntireColumn.AutoFit
Columns("C:F").Select
Selection.EntireColumn.Hidden = True
Columns("H:I").Select
Selection.EntireColumn.Hidden = True
Columns("K:M").Select
Selection.EntireColumn.Hidden = True
Range("A1").Select
If anyone can help with this, that would be great.
Thank you,
Morr