PC Review


Reply
Thread Tools Rate Thread

Appending contents of clipboard to a selected cell range

 
 
Poster
Guest
Posts: n/a
 
      31st Jan 2007
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 With Quote
 
 
 
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      31st Jan 2007
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
>
>

 
Reply With Quote
 
NickHK
Guest
Posts: n/a
 
      1st Feb 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do you remove a selected cell that is not saved on a clipboard Dee haskins Microsoft Access 1 16th Mar 2010 09:58 PM
Macro to transfer contents of 'Selected' cell to alternate cell. Gryndar Microsoft Excel Worksheet Functions 7 20th Dec 2008 09:58 PM
Macro to clear range contents when cell contents are changed by us =?Utf-8?B?U3RldmUgRQ==?= Microsoft Excel Programming 12 22nd Feb 2007 09:09 PM
Rename selected (highlighted) sheet with cell contents of sheets in cell A1 transferxxx@gmail.com Microsoft Excel Programming 2 15th Dec 2006 08:41 AM
Clear Contents of a Selected Range Connie Microsoft Excel Programming 1 11th Oct 2006 09:20 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:59 PM.