• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Extracting Text In Excel Sheet To Multiple Text Files

I am in need of assistance with a code that will extract the text in my excel worksheet to multiple text files. The text in the excel sheet needs to be extracted at a specified line break at each point throughout the excel sheet to the end, and extracted-saved as text files.


They can be saved on my desktop or in a folder (I have no preference where they're extracted to).


Any help is purely appreciated.
 
I figured it out (I guess you can say this is resolved).


However, I'm using html code in my sheets, but Excel extracts it to text with extra parentheses where I don't want them.


Is there anyway to prevent Excel from adding extra parantheses?


I simply would like to extract to text exactly what I'm seeing in Excel.


[pre]<br />
Sub breakup_to_new_sheets()<br />
Application.ScreenUpdating = False<br />
' breakup_to_new_sheets Macro<br />
'</p>
<p>'<br />
Application.Goto Reference:="R1C1:R69C1"<br />
Selection.Copy<br />
Application.CutCopyMode = False<br />
Selection.Cut<br />
Sheets.Add After:=Sheets(Sheets.Count)<br />
ActiveSheet.Paste<br />
Sheets("Sheet1").Select<br />
Rows("1:69").Select<br />
Selection.Delete shift:=xlUp<br />
Application.ScreenUpdating = True<br />
End Sub</p>
<p>Sub wsToText()<br />
Application.ScreenUpdating = False<br />
Dim ws As Worksheet</p>
<p>Application.ScreenUpdating = False<br />
Application.DisplayAlerts = False<br />
For Each ws In ThisWorkbook.Worksheets</p>
<p> Sheets(ws.Name).Select<br />
Sheets(ws.Name).Copy<br />
ActiveWorkbook.SaveAs Filename:= _<br />
"C:UsersAnonymousDesktopExtracted Text Files From Excel" & ws.Name & ".txt", _<br />
FileFormat:=xlUnicodeText, CreateBackup:=False<br />
ActiveWorkbook.Close<br />
ThisWorkbook.Activate<br />
Next<br />
Application.ScreenUpdating = True<br />
End Sub<br />
[/pre]
 
Back
Top