Hello who ever's out there reading this. So, this is my problem....I have an excel spreadsheet which has TONS of data in which I need in acertain format for when I put it into notepad. I only have one column of data in excel, but the output of some of the cells is extremely long, like 2000 characters. In notepad, I am trying to have each line only about 75 characters wide and then the rest has to be put into the next row, and beginning with & and 10 spaces. Is there any way to do this with a macro? I am working in VB right now and this is one I have in order to go from excel to notepad, but is there some information I can add to make rows have certain number of characters and then the rest put in additional rows?
Sub OpNPad_Click()
'Standard Module code!
On Error GoTo Err_OpNPad_Click
ActiveSheet.Select
'Open NotePad with a data file!
'Call Shell("NOTEPAD.EXE u:\Excel\Test\Test.txt", 1)
'Open just the NotePad!
Call Shell("NOTEPAD.EXE", 1)
Exit_OpNPad_Click:
Exit Sub
Err_OpNPad_Click:
MsgBox Err.Description
Resume Exit_OpNPad_Click
End Sub
Sub myTSave()
Dim myFolder As String
'By Joe Was.
'Save Range as Text File.
ActiveSheet.Activate
'Ask user to select range for text file.
Set myRange = Application.InputBox(prompt:="Please select a range!", _
Title:="Text File Range!", Type:=8)
'Ask user for folder to save text file to.
myFolder = Application.GetSaveAsFilename(fileFilter:="Text Files (*.txt), *.txt")
'Save selected data as text file in users selected folder.
ActiveWorkbook.SaveAs Filename:=myFolder, FileFormat:=xlText, CreateBackup:=False
'Indicate save action.
MsgBox "Text File: " & myFolder & "Saved!"
'Go to top of sheet.
Range("A1").Select
End Sub
Thank you so much in advance. I need to get this done by tomorrow, so any help would be greatly appreciated.
Sub OpNPad_Click()
'Standard Module code!
On Error GoTo Err_OpNPad_Click
ActiveSheet.Select
'Open NotePad with a data file!
'Call Shell("NOTEPAD.EXE u:\Excel\Test\Test.txt", 1)
'Open just the NotePad!
Call Shell("NOTEPAD.EXE", 1)
Exit_OpNPad_Click:
Exit Sub
Err_OpNPad_Click:
MsgBox Err.Description
Resume Exit_OpNPad_Click
End Sub
Sub myTSave()
Dim myFolder As String
'By Joe Was.
'Save Range as Text File.
ActiveSheet.Activate
'Ask user to select range for text file.
Set myRange = Application.InputBox(prompt:="Please select a range!", _
Title:="Text File Range!", Type:=8)
'Ask user for folder to save text file to.
myFolder = Application.GetSaveAsFilename(fileFilter:="Text Files (*.txt), *.txt")
'Save selected data as text file in users selected folder.
ActiveWorkbook.SaveAs Filename:=myFolder, FileFormat:=xlText, CreateBackup:=False
'Indicate save action.
MsgBox "Text File: " & myFolder & "Saved!"
'Go to top of sheet.
Range("A1").Select
End Sub
Thank you so much in advance. I need to get this done by tomorrow, so any help would be greatly appreciated.