Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default copying cell text to non-Microsoft application

Hi - i'm trying to copy the contents of a cell to the clipboard (so that I
can then paste it into a non-Microsoft program). When doing it manually,
selecting and copying the cell itself doesn't work - instead I need to 'go
into the cell' and select the text and copy it. How can I do this with VBA?

As an added twist, the cell contains a formula that concatenates text from a
number of other cells (to create a unique code). I actually need to copy
the result of the concatenation to the clipboard.

TIA, John



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default copying cell text to non-Microsoft application

Hi John

This works well here (but so does manual selection and Ctrl C):

Range("A1").Copy

with a formula in A1 and Ctrl V in Notepad it pastes the formula result.

You might have a look at
http://www.cpearson.com/excel/clipboar.htm
for more controlled manipulation of the clipboard.
--
HTH. Best wishes Harald
Followup to newsgroup only please.

"John C" wrote in message ...
Hi - i'm trying to copy the contents of a cell to the clipboard (so that I
can then paste it into a non-Microsoft program). When doing it manually,
selecting and copying the cell itself doesn't work - instead I need to 'go
into the cell' and select the text and copy it. How can I do this with VBA?

As an added twist, the cell contains a formula that concatenates text from a
number of other cells (to create a unique code). I actually need to copy
the result of the concatenation to the clipboard.

TIA, John





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default copying cell text to non-Microsoft application

Harald

Range("A1").Copy and Ctrl C don't work (I need to select and copy the text
inside the cell - from the formula bar), but the link to Chip Pearson's site
looks promising

tks john

"Harald Staff" wrote in message
...
Hi John

This works well here (but so does manual selection and Ctrl C):

Range("A1").Copy

with a formula in A1 and Ctrl V in Notepad it pastes the formula result.

You might have a look at
http://www.cpearson.com/excel/clipboar.htm
for more controlled manipulation of the clipboard.
--
HTH. Best wishes Harald
Followup to newsgroup only please.

"John C" wrote in message

...
Hi - i'm trying to copy the contents of a cell to the clipboard (so that

I
can then paste it into a non-Microsoft program). When doing it

manually,
selecting and copying the cell itself doesn't work - instead I need to

'go
into the cell' and select the text and copy it. How can I do this with

VBA?

As an added twist, the cell contains a formula that concatenates text

from a
number of other cells (to create a unique code). I actually need to

copy
the result of the concatenation to the clipboard.

TIA, John







  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default copying cell text to non-Microsoft application

John

If you copy the contents from the formula bar you will get the formula.

If you copy the cell you will get the concatenated result.

Which do you want? Seems you're asking for both.

Gord Dibben XL2002

On Sun, 30 Nov 2003 21:24:06 +0000 (UTC), "John C"
wrote:

Hi - i'm trying to copy the contents of a cell to the clipboard (so that I
can then paste it into a non-Microsoft program). When doing it manually,
selecting and copying the cell itself doesn't work - instead I need to 'go
into the cell' and select the text and copy it. How can I do this with VBA?

As an added twist, the cell contains a formula that concatenates text from a
number of other cells (to create a unique code). I actually need to copy
the result of the concatenation to the clipboard.

TIA, John



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default copying cell text to non-Microsoft application

the link to Chip's site gave me what i needed; tks ...

Sub CopyTextToClipboard()
Dim DataObject As New DataObject

DataObject.SetText ActiveCell.Text
DataObject.PutInClipboard

End Sub


"Gord Dibben" <gorddibbATshawDOTca wrote in message
...
John

If you copy the contents from the formula bar you will get the formula.

If you copy the cell you will get the concatenated result.

Which do you want? Seems you're asking for both.

Gord Dibben XL2002

On Sun, 30 Nov 2003 21:24:06 +0000 (UTC), "John C"
wrote:

Hi - i'm trying to copy the contents of a cell to the clipboard (so that

I
can then paste it into a non-Microsoft program). When doing it manually,
selecting and copying the cell itself doesn't work - instead I need to

'go
into the cell' and select the text and copy it. How can I do this with

VBA?

As an added twist, the cell contains a formula that concatenates text

from a
number of other cells (to create a unique code). I actually need to copy
the result of the concatenation to the clipboard.

TIA, John





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
Can't Find Microsoft Application Recovery Vick Excel Discussion (Misc queries) 2 January 8th 08 05:21 PM
Microsoft Excel Cell text limits Chris.Coops Excel Discussion (Misc queries) 3 August 13th 07 08:03 PM
microsoft office excel can't start the application Becky Excel Discussion (Misc queries) 0 February 1st 07 03:25 AM
allow all text to be seen in a cell in microsoft excel s.gun Excel Discussion (Misc queries) 2 August 15th 05 06:28 PM
Microsoft Excel is waiting for another application to complete an OLE action Glen Davis Jr. Excel Discussion (Misc queries) 0 May 4th 05 04:10 PM


All times are GMT +1. The time now is 10:05 PM.

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"