PC Review


Reply
Thread Tools Rate Thread

Copy only the colour format from another column

 
 
New Member
Join Date: Oct 2007
Posts: 2
 
      18th Oct 2007
I want to copy only the colour not the contents with no boarders. I search the xlPasteType and this option is not listed.

My current code is below, help?

Sub CopyColourFormat()
Range("C14:C149").Select
Selection.Copy
Range("X14:X149").Select
Selection.PasteSpecial Paste:=xlAllExceptBorders, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False

End Sub


More information:

My original code to colour the master column is:

Sub ColourColumnC()



Dim MyCell As Range

For Each MyCell In Range("C8:C149")



If MyCell.Value Like "L&G" Then

MyCell.Interior.ColorIndex = 35



ElseIf MyCell.Value Like "temp" Then

MyCell.Interior.ColorIndex = 40



ElseIf MyCell.Value Like "returning" Then

MyCell.Interior.ColorIndex = 40



ElseIf MyCell.Value Like "problem" Then

MyCell.Interior.ColorIndex = 53

MyCell.Font.ColorIndex = 2



ElseIf MyCell.Value Like "removed" Then

MyCell.Interior.ColorIndex = 2

MyCell.Interior.Pattern = xlPatternCrissCross

MyCell.Interior.PatternColorIndex = 16

MyCell.Font.ColorIndex = 1

MyCell.Font.Bold = True



ElseIf MyCell.Value Like "printer" Then

MyCell.Interior.ColorIndex = 2

MyCell.Interior.Pattern = xlPatternCrissCross

MyCell.Interior.PatternColorIndex = 16

MyCell.Font.ColorIndex = 1

MyCell.Font.Bold = True



ElseIf MyCell.Value Like "reserved" Then

MyCell.Interior.ColorIndex = 36



ElseIf MyCell.Value Like "empty" Then

MyCell.Interior.ColorIndex = 15

Else
MyCell.Interior.ColorIndex = xlNone

End If

Next



End Sub

Last edited by MadeleineBuchberger; 18th Oct 2007 at 04:57 PM..
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I copy format (eg colour of cells) in a drop down list SamR Microsoft Excel Worksheet Functions 1 9th Dec 2009 07:01 PM
how do I copy format (eg colour of cells) in a drop down list SamR Microsoft Excel Worksheet Functions 0 9th Dec 2009 04:28 AM
Column charts - format colour by value Bernster Microsoft Excel Charting 2 2nd Oct 2008 04:22 PM
copy colour assaf1978 Microsoft Excel Misc 3 27th Aug 2008 09:37 PM
Excel VB - Copy only the colour format from columns MadeleineBuchberger Windows XP 0 17th Oct 2007 04:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:31 AM.