This is what i got so far, its a work in progress....
Sub Findexpand()
Dim rFound As Range
Dim FCell As String
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("Test")
Dim k As Long
Dim tmpFile As String
Dim MyData As String, strData() As String
Dim entireline As String
Dim filesize As Integer
On Error Resume Next
Set rFound = Cells.Find(What:="*", _
After:=Cells(Rows.Count, Columns.Count), _
LookAt:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
On Error GoTo 0
If rFound Is Nothing Then
MsgBox "Done"
End If
Else
FCell = rFound.Address(RowAbsolute:=False, ColumnAbsolute:=False, External:=False)
k = sh.Range(FCell, sh.Range(FCell).End(xlDown).End(xlDown).End(xlUp)).Rows.Count
ActiveSheet.Range(FCell).Select
Selection.Resize(numRows + k, numColumns + 50).Select
Selection.Cut
ActiveWorkbook.Sheets.Add After:=Worksheets(Worksheets.Count)
ActiveSheet.Paste
'~~> Change this where and how you want to save the file
Const FlName = "C:\Users\Desktop\Chunk1.txt"
'~~> Create a Temp File
tmpFile = TempPath & Format(Now, "ddmmyyyyhhmmss") & ".txt"
ActiveWorkbook.SaveAs Filename:=tmpFile _
, FileFormat:=xlText, CreateBackup:=False
'~~> Read the entire file in 1 Go!
Open tmpFile For Binary As #1
MyData = Space$(LOF(1))
Get #1, , MyData
Close #1
strData() = Split(MyData, vbCrLf)
'~~> Get a free file handle
filesize = FreeFile()
'~~> Open your file
Open FlName For Output As #filesize
For i = LBound(strData) To UBound(strData)
entireline = Replace(strData(i), """", "")
'~~> Export Text
Print #filesize, entireline
Next i
Close #filesize
Application.DisplayAlerts = False
Worksheets(Worksheets.Count).Activate
ActiveSheet.Delete
Application.DisplayAlerts = True
MsgBox "Done"
' Kill tmpFile
End If
End Sub
Bookmarks