Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Format Paste from nonmerged cell to merged cell

Is there a method to paste from a nonmerged cell to a merged cell the color
of the originator? I am able to use this macro to copy the number, but I
need the originating color from time to time and wondered if it that could
be included in the macro.

Sub CopyProductCells
ActiveCell.Select
Selection.Copy
ActiveSheet.Previous.Select

ActiveCell.Select
Selection.PasteSpecial Paste:=xlFormulas, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False

End Sub

Annette


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Format Paste from nonmerged cell to merged cell


Most people would recommend that you avoid using Merged Cells


--
royUK

Hope that helps, RoyUK
For tips & examples visit my 'web site
' (http://www.excel-it.com)
------------------------------------------------------------------------
royUK's Profile: http://www.thecodecage.com/forumz/member.php?userid=15
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=33823

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Format Paste from nonmerged cell to merged cell

You could store the .Interior.ColorIndex property of the merged area to a
variable and apply same to the destination range. You could do that in
tandem with your paste special.

Regards,
Peter T


"Annette" wrote in message
...
Is there a method to paste from a nonmerged cell to a merged cell the
color of the originator? I am able to use this macro to copy the number,
but I need the originating color from time to time and wondered if it that
could be included in the macro.

Sub CopyProductCells
ActiveCell.Select
Selection.Copy
ActiveSheet.Previous.Select

ActiveCell.Select
Selection.PasteSpecial Paste:=xlFormulas, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False

End Sub

Annette



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Format Paste from nonmerged cell to merged cell

Peter, can you tell me how I would do this?

Thanks!

"Peter T" <peter_t@discussions wrote in message
...
You could store the .Interior.ColorIndex property of the merged area to a
variable and apply same to the destination range. You could do that in
tandem with your paste special.

Regards,
Peter T


"Annette" wrote in message
...
Is there a method to paste from a nonmerged cell to a merged cell the
color of the originator? I am able to use this macro to copy the number,
but I need the originating color from time to time and wondered if it
that could be included in the macro.

Sub CopyProductCells
ActiveCell.Select
Selection.Copy
ActiveSheet.Previous.Select

ActiveCell.Select
Selection.PasteSpecial Paste:=xlFormulas, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False

End Sub

Annette





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Format Paste from nonmerged cell to merged cell

The following is based as best I can on what you posted earlier. Not sure
it'll work as required but see how you get on.

Generally it's not usually necessary to select something, though with your
'ActiveSheet.Previous.Select' in this case looks as if it is.

Sub test()
Dim clrIdx As Long
Dim rngSource As Range
Dim rngDest As Range

Set rngSource = Selection
rngSource.Copy
clrIdx = rngSource(1).Interior.ColorIndex

ActiveSheet.Previous.Select
Set rngDest = Selection

rngDest.PasteSpecial Paste:=xlFormulas
rngDest.Interior.ColorIndex = clrIdx

End Sub

Regards,
Peter T

"Annette" wrote in message
...
Peter, can you tell me how I would do this?

Thanks!

"Peter T" <peter_t@discussions wrote in message
...
You could store the .Interior.ColorIndex property of the merged area to a
variable and apply same to the destination range. You could do that in
tandem with your paste special.

Regards,
Peter T


"Annette" wrote in message
...
Is there a method to paste from a nonmerged cell to a merged cell the
color of the originator? I am able to use this macro to copy the
number, but I need the originating color from time to time and wondered
if it that could be included in the macro.

Sub CopyProductCells
ActiveCell.Select
Selection.Copy
ActiveSheet.Previous.Select

ActiveCell.Select
Selection.PasteSpecial Paste:=xlFormulas, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False

End Sub

Annette







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
Autofit Merged cell Code is changing the format of my merged cells JB Excel Discussion (Misc queries) 0 August 20th 07 02:12 PM
Merged cell paste NIGHTMARE [email protected] Excel Discussion (Misc queries) 2 May 9th 07 05:00 PM
How can I paste into a merged cell? Gary Reed Excel Discussion (Misc queries) 3 June 29th 06 02:41 PM
How do I copy data in single cell format to a merged cell format Paul Excel Discussion (Misc queries) 1 June 27th 05 11:00 AM
Copy Paste Merged Cell Format Jim May Excel Programming 6 November 11th 04 02:35 PM


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