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

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,300
Office Version
  1. 365
Platform
  1. Windows
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
 

joseoom

Board Regular
Joined
Oct 15, 2004
Messages
100
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.
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,300
Office Version
  1. 365
Platform
  1. Windows
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.
 

joseoom

Board Regular
Joined
Oct 15, 2004
Messages
100
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?
 

Forum statistics

Threads
1,136,586
Messages
5,676,671
Members
419,642
Latest member
Hyakkivn

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
Top