RE : upload data from excel to notepad

  • Thread starter Thread starter reachsuja.sada
  • Start date Start date
R

reachsuja.sada

Hi

Can anyone tell me what are all the ways to upload data from Excel
sheet to notepad

Thanks in Advance.
Sujatha
 
1.. Open the workbook you want to save for use in another program.
2.. On the File menu, click Save As.
3.. In the File name box, type a new name for the workbook.
4.. In the Save as type list, click a file format that you know you can
open in the other program. (e.g. For Notepad select any file format having
*.txt )
5.. Click Save.


Using Macro try this,


Sub Export2Notepad()
'saves active worksheet as text file in current directory
'& opens in Notepad.
Const txtfilename As String = "Book2.txt"
Dim wb As Workbook
On Error GoTo xit
If ActiveSheet.Type = xlWorksheet Then
ActiveSheet.Copy
Set wb = ActiveWorkbook
Application.DisplayAlerts = False
wb.SaveAs Filename:= _
txtfilename, FileFormat:=xlTextMSDOS, _
CreateBackup:=False
Application.DisplayAlerts = True
wb.Close False
Shell "Notepad " & CurDir & "\" & txtfilename, vbNormalFocus
Else
MsgBox "Please select Worksheet to export to Notepad.", vbCritical,
"Export to Notepad"
End If
Exit Sub
xit:
MsgBox Err.Description
End Sub

Regards,
Shailesh Shah
http://in.geocities.com/shahshaileshs/
(Excel Add-ins Page)
If You Can't Excel with Talent, Triumph with Effort.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top