Get output in notepad by VBA

santoshloka

Board Regular
Joined
Aug 31, 2017
Messages
125
i have some random Data in excel sheet which i want them in notepad

is it possible by VBA Code?

1=Text,2=Number,3=ID No..etc
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Re: how to get output in notepad by VBA

In the absence of anything further to go on:

Code:
Sub test()

Open "C:\temp\test.txt" For Output As [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=1]#1[/URL] 
    Print [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=1]#1[/URL] , "1=Text,2=Number,3=ID No..etc"
Close [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=1]#1[/URL] 

End Sub
 
Upvote 0
Re: how to get output in notepad by VBA

Code:
Sub outputToTxt()

Dim filePath as String
Dim textFile as Integer
Dim wholeFile As String

filePath = "C:\Users\Windows\Desktop & "\" & "NAMEYOUWANTTOSAVEFILEAS" & ".txt."" 'here you should enter the location where you want notepad to be saved on your computer
textFile = FreeFile

Print [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=TextFile][URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=Textfile]#Textfile[/URL] [/URL] , textYouWantToEnter 'overwrite textYouWantToEnter with the text you want to be output to notepad
Print [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=TextFile][URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=Textfile]#Textfile[/URL] [/URL] , textYouWantToEnter 'overwrite textYouWantToEnter with the text you want to be output to notepad
Print [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=TextFile][URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=Textfile]#Textfile[/URL] [/URL] , textYouWantToEnter 'overwrite textYouWantToEnter with the text you want to be output to notepad
Print [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=TextFile][URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=Textfile]#Textfile[/URL] [/URL] , textYouWantToEnter 'overwrite textYouWantToEnter with the text you want to be output to notepad
etc, etc.

Close [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=TextFile][URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=Textfile]#Textfile[/URL] [/URL]
 
Upvote 0
Re: how to get output in notepad by VBA

can yu make random excel sheet with code which can help to generate notepad document

take few cells and export them.
this is my intention
 
Upvote 0
Re: how to get output in notepad by VBA

Just put that code in a module and run it. I'm not making you a workbook when you can do it much faster yourself
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,279
Members
452,630
Latest member
OdubiYouth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top