Copy color from a (group of) cells with conditonal formatting

UHsoccer

Well-known Member
Joined
Apr 3, 2002
Messages
1,023
I have a large block of cells with conditional formatting
Need to copy ONLY the color of those cells to other cells
When I do a "copy/paste format" it includes the conditional aspects of those cells. I just need the color ONLY

Your comments are appreciated
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Hello

As per my understanding Try this

VBA Code:
Sub FormatCopy()
Worksheets("Source").Range("A1:B10").Copy
Worksheets("Destination").Range("A1:B10").PasteSpecial xlPasteFormats
Application.CutCopyMode = False
End Sub
 
Upvote 0
When I do a "copy/paste format" it includes the conditional aspects of those cells. I just need the color ONLY
I think that you would have to do it via VBA using the DisplayFormat.Interior.Color or DisplayFormat.Interior.ColorIndex property.

Please note that the DisplayFormat property does not work in User Defined Functions (UDF)
 
Upvote 0
Here is my current code, not really sure how to apply your suggestion

VBA Code:
Sub Match_Color()
'
'   copy cell color from U3:V16 to C3:D16
'
    Range("U3:V16").Select  ' it contains conditional formatting
    Selection.Copy
    Range("C3:D16").Select  ' copy COLOR only
    Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
    
End Sub
 
Upvote 0
Maybe...
VBA Code:
Sub Match_Color()
    Dim myCell As Range
    Application.ScreenUpdating = False

    For Each myCell In Range("C3:D16")
        myCell.Interior.Color = myCell.Offset(, 18).DisplayFormat.Interior.Color
    Next

    Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,569
Messages
6,125,600
Members
449,238
Latest member
wcbyers

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top