Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default How can I copy plain text from Excel to Notepad?

I have used the CONCATENATE function to put together a header for a SQL
script all in one cell. In Excel, this uses CHAR(10) as the newline
character, and displays on multiple lines within a single cell. I would like
to be able to copy this to Notepad so I can make a "clean" version to send
along to DBAs, but when it moves to Notepad, I get a big mess of non-printing
characters. (And if I use the CLEAN function in Excel, the format goes away
entirely)

Any ideas how to preserve the format in the cell, but still have the text
copyable to Notepad?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 897
Default How can I copy plain text from Excel to Notepad?

When you select the cell, press Ctrl-C to copy, then switch to Notepad
and paste, is that what happens?

--JP

On Oct 1, 2:58*pm, ymgagnon
wrote:
I have used the CONCATENATE function to put together a header for a SQL
script all in one cell. *In Excel, this uses CHAR(10) as the newline
character, and displays on multiple lines within a single cell. *I would like
to be able to copy this to Notepad so I can make a "clean" version to send
along to DBAs, but when it moves to Notepad, I get a big mess of non-printing
characters. *(And if I use the CLEAN function in Excel, the format goes away
entirely)

Any ideas how to preserve the format in the cell, but still have the text
copyable to Notepad?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default How can I copy plain text from Excel to Notepad?

Yes. And it does seem to be an issue with the newline character CHAR(10)
(ASCII 10). But I tried with CHAR(13) instead to see if it would be handled
better...and no luck. I'd like to avoid washing it through too many
steps...but I got it to work if I drop it in Word, then save as a text file.
I'd like it to be as easy to hand over to someone else as possible, though,
and don't relish trying to explain to everyone else who uses it how to save
Word docs as text in the correct format...

"JP" wrote:

When you select the cell, press Ctrl-C to copy, then switch to Notepad
and paste, is that what happens?

--JP

On Oct 1, 2:58 pm, ymgagnon
wrote:
I have used the CONCATENATE function to put together a header for a SQL
script all in one cell. In Excel, this uses CHAR(10) as the newline
character, and displays on multiple lines within a single cell. I would like
to be able to copy this to Notepad so I can make a "clean" version to send
along to DBAs, but when it moves to Notepad, I get a big mess of non-printing
characters. (And if I use the CLEAN function in Excel, the format goes away
entirely)

Any ideas how to preserve the format in the cell, but still have the text
copyable to Notepad?


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 897
Default How can I copy plain text from Excel to Notepad?

Can you post the formula?

--JP

On Oct 1, 3:27*pm, ymgagnon
wrote:
Yes. *And it does seem to be an issue with the newline character CHAR(10)
(ASCII 10). *But I tried with CHAR(13) instead to see if it would be handled
better...and no luck. *I'd like to avoid washing it through too many
steps...but I got it to work if I drop it in Word, then save as a text file. *
I'd like it to be as easy to hand over to someone else as possible, though,
and don't relish trying to explain to everyone else who uses it how to save
Word docs as text in the correct format...



"JP" wrote:
When you select the cell, press Ctrl-C to copy, then switch to Notepad
and paste, is that what happens?


--JP


On Oct 1, 2:58 pm, ymgagnon
wrote:
I have used the CONCATENATE function to put together a header for a SQL
script all in one cell. *In Excel, this uses CHAR(10) as the newline
character, and displays on multiple lines within a single cell. *I would like
to be able to copy this to Notepad so I can make a "clean" version to send
along to DBAs, but when it moves to Notepad, I get a big mess of non-printing
characters. *(And if I use the CLEAN function in Excel, the format goes away
entirely)


Any ideas how to preserve the format in the cell, but still have the text
copyable to Notepad?

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default How can I copy plain text from Excel to Notepad?

You could use a macro:

Option Explicit
Sub testme()

Dim MyDataObj As DataObject
Dim myStr As String

Set MyDataObj = New DataObject

myStr = activecell.text '.value???

'I'm confused about what clean means.
'vbcr = chr(13); vblf = chr(10); vbcrlf = chr(13)&chr(10)

myStr = Replace(myStr, vbCrLf, " ")
myStr = Replace(myStr, vbCr, " ")
myStr = Replace(myStr, vbLf, " ")

MyDataObj.SetText myStr
MyDataObj.PutInClipboard

End Sub

Chip Pearson has some notes that you'll want to read.
http://www.cpearson.com/excel/clipboard.htm

Especially the note about using tools|references and checking "Microsoft Forms
2.0 object library").

ymgagnon wrote:

I have used the CONCATENATE function to put together a header for a SQL
script all in one cell. In Excel, this uses CHAR(10) as the newline
character, and displays on multiple lines within a single cell. I would like
to be able to copy this to Notepad so I can make a "clean" version to send
along to DBAs, but when it moves to Notepad, I get a big mess of non-printing
characters. (And if I use the CLEAN function in Excel, the format goes away
entirely)

Any ideas how to preserve the format in the cell, but still have the text
copyable to Notepad?


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default How can I copy plain text from Excel to Notepad?

That might be a bit complicated. It's pulling data from across two tabs,
combining static text with entered values to creat individual lines of the
header, and then the header itself is put together by that final concatenate.
So...the final formula looks like ('Product Lookup - bin' being the second
tab where the lines are being assembled):

=CONCATENATE('Product Lookup - bin'!A4,'Product Lookup - bin'!A5,'Product
Lookup - bin'!A6,'Product Lookup - bin'!A7,'Product Lookup - bin'!A8,'Product
Lookup - bin'!A9,'Product Lookup - bin'!A10,'Product Lookup -
bin'!A11,'Product Lookup - bin'!A12,'Product Lookup - bin'!A13,'Product
Lookup - bin'!A14,'Product Lookup - bin'!A15,'Product Lookup -
bin'!A16,'Product Lookup - bin'!A17,'Product Lookup - bin'!A18,'Product
Lookup - bin'!A19,'Product Lookup - bin'!A20,'Product Lookup -
bin'!A21,'Product Lookup - bin'!A22,'Product Lookup - bin'!A23,'Product
Lookup - bin'!A24,)

Here are a couple from the other tab:
A4: ="/*File Name: "&'Product Lookup'!B4
A5: =CHAR(10)&"|"
A6: =CHAR(10)&"| Script Description: "&MID('Product Lookup'!B6,1,28)

(And so on...)


"JP" wrote:

Can you post the formula?

--JP

On Oct 1, 3:27 pm, ymgagnon
wrote:
Yes. And it does seem to be an issue with the newline character CHAR(10)
(ASCII 10). But I tried with CHAR(13) instead to see if it would be handled
better...and no luck. I'd like to avoid washing it through too many
steps...but I got it to work if I drop it in Word, then save as a text file.
I'd like it to be as easy to hand over to someone else as possible, though,
and don't relish trying to explain to everyone else who uses it how to save
Word docs as text in the correct format...



"JP" wrote:
When you select the cell, press Ctrl-C to copy, then switch to Notepad
and paste, is that what happens?


--JP


On Oct 1, 2:58 pm, ymgagnon
wrote:
I have used the CONCATENATE function to put together a header for a SQL
script all in one cell. In Excel, this uses CHAR(10) as the newline
character, and displays on multiple lines within a single cell. I would like
to be able to copy this to Notepad so I can make a "clean" version to send
along to DBAs, but when it moves to Notepad, I get a big mess of non-printing
characters. (And if I use the CLEAN function in Excel, the format goes away
entirely)


Any ideas how to preserve the format in the cell, but still have the text
copyable to Notepad?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Excel Tab delimited to Notepad tcmh Excel Discussion (Misc queries) 1 May 3rd 09 10:55 PM
how to copy excel carriage return to notepad w/out the quotations BB Excel Worksheet Functions 4 July 10th 08 06:52 PM
How do i copy columns of data in notepad into microsoft excel? JP New Users to Excel 2 February 10th 05 09:47 PM
How do i copy columns of data in notepad into excel? JJ Excel Discussion (Misc queries) 1 February 10th 05 09:21 PM
How do i copy columns of data in notepad into microsoft excel? Jason Excel Discussion (Misc queries) 1 February 10th 05 09:20 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"