- Joined
- Oct 17, 2007
- Messages
- 2
- Reaction score
- 0
VB code PasteSpecial
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
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: