Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Appending contents of clipboard to a selected cell range

Greetings. I maintain a large group of spreadsheets that require the
same text to be appended to the contents of various cells. These cell
ranges are not known in advance.

I'm looking for a macro that does this:

* Appends the content of the clipboard (including font format) to each
cell in a range. This range of cells is not hardcoded within the
macro.

So far I have not been able to find a macro that does such a thing, or
even the information necessary to code it. Any advice appreciated.

Thanks.
-- Poster

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Appending contents of clipboard to a selected cell range

If you want to do Rich Text formatting, I believe the easiest would be to
paste the clipboard to a cell, then have your macro capture the text and
formatting in that cell and reproduce it character by character in your
target cells using the characters collection.

Turn on the macro recorder and rich text format an existing string, then
turn off the macro recorder. This will give you a good example of using the
characters collection.

--
Regards,
Tom Ogilvy



"Poster" wrote:

Greetings. I maintain a large group of spreadsheets that require the
same text to be appended to the contents of various cells. These cell
ranges are not known in advance.

I'm looking for a macro that does this:

* Appends the content of the clipboard (including font format) to each
cell in a range. This range of cells is not hardcoded within the
macro.

So far I have not been able to find a macro that does such a thing, or
even the information necessary to code it. Any advice appreciated.

Thanks.
-- Poster


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Appending contents of clipboard to a selected cell range

Inherent VBA access to the clipboard is limited to the DataObject. But
according to help "The DataObject currently supports only text formats."
This is in XL XP, so not sure if the "currently" still applies in later
versions.
If so, and you need the formatting, then go Tom's way. Otherwise use the
DataObject.

NickHK

"Poster" wrote in message
oups.com...
Greetings. I maintain a large group of spreadsheets that require the
same text to be appended to the contents of various cells. These cell
ranges are not known in advance.

I'm looking for a macro that does this:

* Appends the content of the clipboard (including font format) to each
cell in a range. This range of cells is not hardcoded within the
macro.

So far I have not been able to find a macro that does such a thing, or
even the information necessary to code it. Any advice appreciated.

Thanks.
-- Poster



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
Macro to transfer contents of 'Selected' cell to alternate cell. Gryndar Excel Worksheet Functions 7 December 20th 08 09:58 PM
Rename selected (highlighted) sheet with cell contents of sheets in cell A1 [email protected] Excel Programming 2 December 15th 06 08:41 AM
Clear Contents of a Selected Range Connie Excel Programming 1 October 11th 06 09:20 AM
Copy outside Clipboard contents (html page) to a cell in Excel sifar Excel Programming 9 September 12th 05 11:46 PM
Copy outside Clipboard contents (html page) to a cell in Excel sifar Excel Programming 2 September 3rd 05 03:40 AM


All times are GMT +1. The time now is 12:12 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"