'Delete Column 50
Dim objFSO, dataArray, clippedArray()
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Create an array out of the CSV
'open the data file
Set oTextStream = objFSO.OpenTextFile("C:\Myfile.csv")
'make an array from the data file
dataArray = Split(oTextStream.ReadAll, vbNewLine)
'close the data file
oTextStream.Close
Set newFile = objFSO.CreateTextFile("C:\Myfile.csv")
x = 0
For Each strLine In dataArray
'Now make an array from each line
ReDim Preserve clippedArray(x)
clippedArray(x) = Split(strLine, ",")
CutColumn = 50
intCount = 0
NewLine = vbCrLf
For Each Element In clippedArray(x)
If intCount = UBound(clippedArray(x)) Then
Else
EndChar = ","
End If
If intCount <> CutColumn Then
NewLine = NewLine & Element & EndChar
End If
intCount = intCount + 1
If intCount = UBound(clippedArray(x)) Then
newFile.Write NewLine
End If
Next
Next
newFile.Close
'DELETE TOP BLANK LINE
Dim iFile As Integer
Dim sData As String
iFile = FreeFile
Open "C:\Myfile.csv" For Binary Access Read As iFile
sData = Space(LOF(iFile))
Get #iFile, , sData
Close iFile
sData = Mid(sData, InStr(sData, vbCrLf) + 2)
Kill "C:\Myfile.csv"
iFile = FreeFile
Open "C:\Myfile.csv" For Binary Access Write As iFile
Put #iFile, , sData
Close iFile