Transfer automatically the format of one cell to other cell

  • Thread starter Thread starter Dinos
  • Start date Start date
D

Dinos

I have applied specific formats to cells (format of the fonts)on
sheet.
On the same workbook but on different sheet i have some cells gettin
their values directly from cells of the first sheet.
Example:
The value of the cell C4 of the sheet 2 is given by: =sheet1!C22

HOW can i keep the existing font type of shell C22 on cell C4, bu
without apllying it to each one individually

Thanks for your tim
 
Hi
not really possible:
- formulas only return values but can't transfer formats
- an event procedure is also not bullet proof as for example the
worksheet_change event is not triggered by a format change
 
One way:

You can use a worksheet_activate event macro. Put this in the worksheet
code module of your sheet2 (right click the sheet2 tab and choose View
Code):

Say Sheet2!A1 has the formula "=Sheet1!A10", and Sheet2!C4 has the
formula "=Sheet1!C22"

Private Sub Worksheet_Activate()
Dim vCellList As Variant
Dim i As Long

vCellList = Array("A1", "A10", "C4", "C22")
Application.ScreenUpdating = False
For i = LBound(vCellList) To UBound(vCellList) Step 2
Sheets("Sheet1").Range(vCellList(i + 1)).Copy
Range(vCellList(i)).PasteSpecial Paste:=xlFormats
Next i
Application.ScreenUpdating = True
End Sub

Substitute your pairs of cells as appropriate.
 
Back
Top