Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Pasting internal cell format from 1 cell to another

Being new to this and no VB expert I'm trying to write a script to copy
internal cell format values from 1 sheet/cell to another.

I am using ".PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone,
skipBlanks:=False, Transpose:=False" and this works for the cell format
itself.

However if I go into the cell content (the fx line) and (for example) BOLD
the first three word and then change the font colour of the 12th word, then
the pastespecial command does not seem to work.

What should I do ensure the formatting internal to a cell is pasted accross?

Thx.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Pasting internal cell format from 1 cell to another

In that case, the color property applies to the text or characters object and
not the cell object. Only the cell format properties are pasted with the
paste special. However, If you copy the cell and just paste, then the font
color does stay with the single word. Or you can format the entire cell for
font color and it will transfer the format because it is applied at the cell
level instead of the text or character level.

"Flossie" wrote:

Being new to this and no VB expert I'm trying to write a script to copy
internal cell format values from 1 sheet/cell to another.

I am using ".PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone,
skipBlanks:=False, Transpose:=False" and this works for the cell format
itself.

However if I go into the cell content (the fx line) and (for example) BOLD
the first three word and then change the font colour of the 12th word, then
the pastespecial command does not seem to work.

What should I do ensure the formatting internal to a cell is pasted accross?

Thx.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Pasting internal cell format from 1 cell to another


I'm afraid this didn't work.

Replaced pastespecial in: " With
ActiveWorkbook.Sheets("XXX").Range("A9:S9").Copy
End With
With ActiveWorkbook.Sheets("YYY").Range("A4:S4")
.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone,
skipBlanks:=False, Transpose:=False
End With"

to read: "With ActiveWorkbook.Sheets("YYY").Range("A4:S4").Paste
End with"

The text was copied but the internal formatting wasn't.


"JLGWhiz" wrote:

In that case, the color property applies to the text or characters object and
not the cell object. Only the cell format properties are pasted with the
paste special. However, If you copy the cell and just paste, then the font
color does stay with the single word. Or you can format the entire cell for
font color and it will transfer the format because it is applied at the cell
level instead of the text or character level.

"Flossie" wrote:

Being new to this and no VB expert I'm trying to write a script to copy
internal cell format values from 1 sheet/cell to another.

I am using ".PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone,
skipBlanks:=False, Transpose:=False" and this works for the cell format
itself.

However if I go into the cell content (the fx line) and (for example) BOLD
the first three word and then change the font colour of the 12th word, then
the pastespecial command does not seem to work.

What should I do ensure the formatting internal to a cell is pasted accross?

Thx.



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
Internal cell margins (Excel 2003) Helen Excel Discussion (Misc queries) 1 July 8th 09 01:51 AM
in an Excel table how do I set cell internal margins??? Brit in US Excel Discussion (Misc queries) 5 January 26th 09 04:29 PM
Copying cell contents from many cells and pasting into one cell MDN Excel Discussion (Misc queries) 7 December 10th 07 08:56 PM
Text box to determine internal format color oldybutgoody Excel Programming 1 October 23rd 07 02:56 PM
Losing Original Cell Format when pasting in cells mrbill Excel Discussion (Misc queries) 1 December 10th 06 04:10 PM


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