Copying to notepad

joseoom

Board Regular
Joined
Oct 15, 2004
Messages
100
I have the following question:

I want my code to copy a certain amount of information from excel, open a new notepad document and copy it there.

After that if possible save the notepad and attach it to an email.

I think that's impossible, but if someone can help I would greatly appreciate it.

Thanks!
Jose
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Jose

Why not just create a text file?

I don't see any need to do this via Notepad, VBA has various file input/output methods.

As for the attachment part, the code for that would depend on your email client. eg Outlook, Lotus Notes etc
 
Upvote 0
you are absolutly right. I can save as a text file. But how do I do that?

To do the email part I use outlook.
 
Upvote 0
Jose

The text part depends on what you actually want to do.

Do you want to create a text file based on a particular range?

For the email part try searching the forum for Outlook.

You'll find plenty of examples, most of which will deal with attaching workbooks/sheets but they will be easily adapt to work with a text file.
 
Upvote 0
Ok, half the work done I am left with one question.

I have managed to save as text. How can I name the file after a given cell.

Supose cell A1 says "Report 09-22" how can I make my txt file call that?
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,427
Members
448,961
Latest member
nzskater

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