ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   RE : upload data from excel to notepad (https://www.excelbanter.com/excel-worksheet-functions/147437-re-upload-data-excel-notepad.html)

[email protected]

RE : upload data from excel to notepad
 
Hi

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

Thanks in Advance.
Sujatha


shah shailesh

upload data from excel to notepad
 

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.



wrote in message
ups.com...
Hi

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

Thanks in Advance.
Sujatha





All times are GMT +1. The time now is 08:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com