Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Copy cell with individual formatting

I need to copy programmaticly some range from one spreadsheet to another.
Cells are formated (In one cell each word has individual
format -strikethrough, bold ).
I know that I can use Copy Method but this method use clipboard and after it
finish clipboard is empty. Is there a way to copy range without using
clipboard.


--
Arkadiusz Żurawek




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 176
Default Copy cell with individual formatting

Arkaad,

Try using the copy command with the target range immediately
following, all on one line:

Range("C3").Copy Range("C4")

HTH,
Bernie


"Arkaad" wrote in message
...
I need to copy programmaticly some range from one spreadsheet to

another.
Cells are formated (In one cell each word has individual
format -strikethrough, bold ).
I know that I can use Copy Method but this method use clipboard and

after it
finish clipboard is empty. Is there a way to copy range without

using
clipboard.


--
Arkadiusz Żurawek






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Copy cell with individual formatting

The only way I know of to copy a cell with individual characters formatted
without using the clipboard is like this:

Range("Dest").Value(xlRangeValueXMLSpreadsheet) = _
Range("Src").Value(xlRangeValueXMLSpreadsheet)

Unfortunately this method is available only in Excel 2003 and 2003.

The only workaround for earlier versions that comes to mind is to paste the
current clipboard contents to a holding sheet, do the normal Excel
copy/paste, and then copy from the holding sheet. How well this works
depends on what is originally in the clipboard.

--
Jim Rech
Excel MVP


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Copy cell with individual formatting

This does seem to clear the clipboard unfortunately, Bernie.

--
Jim Rech
Excel MVP


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 176
Default Copy cell with individual formatting

Jim,

This does seem to clear the clipboard unfortunately, Bernie.


I thought that was what he wanted....

Is there a way to copy range without using clipboard.


But after rereading, I guess he meant 'without clearing" clipboard.

Bernie






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Copy cell with individual formatting

You can always get the text, then match it character for character to the
original for the need attributes.

Sub CopyCharacters()
Dim rng1 As Range
Dim rng2 As Range
Dim i As Long
Set rng1 = Cells(1, 1)
Set rng2 = Range("B9")

rng2.Value = rng1.Value
For i = 1 To Len(rng1.Value)
With rng2.Characters(i, 1).Font
.Name = rng1.Characters(i, 1).Font.Name
.Bold = rng1.Characters(i, 1).Font.Bold
.Italic = rng1.Characters(i, 1).Font.Italic
.Underline = rng1.Characters(i, 1).Font.Underline
.ColorIndex = rng1.Characters(i, 1).Font.ColorIndex
End With
Next

End Sub

--
Regards,
Tom Ogilvy


"Arkaad" wrote in message
...
I need to copy programmaticly some range from one spreadsheet to another.
Cells are formated (In one cell each word has individual
format -strikethrough, bold ).
I know that I can use Copy Method but this method use clipboard and after

it
finish clipboard is empty. Is there a way to copy range without using
clipboard.


--
Arkadiusz Żurawek






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&paste 28 individual files into one file/28 work sheets Yvez T.T. Constance Excel Worksheet Functions 1 November 18th 07 10:54 AM
Formatting Individual Columns CommerceMary Setting up and Configuration of Excel 1 August 2nd 07 09:44 PM
Apply conditional formatting to individual cell Excel 2007 James D Excel Worksheet Functions 3 June 3rd 07 09:59 PM
Excel graphs should allow copy & paste of individual bar formats belohls Charts and Charting in Excel 1 July 1st 06 10:32 AM
sort data by name in first column and copy to individual worksheets by name srfrost Excel Programming 3 September 24th 03 01:51 AM


All times are GMT +1. The time now is 04:14 PM.

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

About Us

"It's about Microsoft Excel"