How can colour of cell shading be fixed to one colour

T

Tabrez

How can colour of cell shading be fixed to one colour and it does not changes
when new contents are pasted in that cell.
 
N

Nastech

unless you get someone to program it for you.. repost ask for script..
otherwise have simple answers:
- right click cell(s), paste-special values
- all cells start with same / no formatting
- smallest equation / formula for format I have found, for wanting fomatted
cell:
=0=0
=COUNTA(F9)=1
 
G

Gord Dibben

You could use this event code to retain the Formatting of the target cells.

Note: does not work if cells are CUT and pasted

Private Sub Worksheet_Change(ByVal Target As Range)
'retain formatting when a cell is copied over
Dim myValue
With Application
.EnableEvents = False
myValue = Target.Value
.Undo
Target = myValue
.EnableEvents = True
End With
End Sub

Right-click on the sheet tab and "View Code". Copy/paste the code into that
sheet module.

Alt + q to return to the Excel window.


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top