Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Autofit Merged cell Code is changing the format of my merged cells | Excel Discussion (Misc queries) | |||
Merged cell paste NIGHTMARE | Excel Discussion (Misc queries) | |||
How can I paste into a merged cell? | Excel Discussion (Misc queries) | |||
How do I copy data in single cell format to a merged cell format | Excel Discussion (Misc queries) | |||
Copy Paste Merged Cell Format | Excel Programming |