cell formats

  • Thread starter Thread starter Pete
  • Start date Start date
P

Pete

Hi,

is there a way to change a cell format based on another
cells formats?

e.g. I have colour coded processed data in one sheet and
the original data in a separate sheet. Hence the value in
cell sheet1!G3 was derived from the value of cell sheet2!
G3. I basically want a conditional format which sets
formats of cell sheet1!G3 equal to the format of sell
sheet2!G3.
Thanks in advance
Pete
 
Hi Pete
this is IMHO nearly impossible. E.g. a format change does not trigger
the worksheet_change event. therefore also a event procedure won't work
in all circumstances (only if the value is changed it would be possible
to copy the format of a cell to another one).
 
Conditional formatting can't do that, but an event macro can:

Put this in your worksheet code module (right-click the worksheet tab
and select View Code):


Private Sub Worksheet_Activate()
Sheets("Sheet2").Range("G3").Copy
Range("G3").PasteSpecial Paste:=xlPasteFormats
Application.CutCopyMode = False
End Sub
 
Back
Top