View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Walter Briscoe Walter Briscoe is offline
external usenet poster
 
Posts: 279
Default Merging cells and formats

In message of Sun, 5 Jan 2014 12:31:55 in
microsoft.public.excel.worksheet.functions, GS
writes
I use Excel 2003.
I have a worksheet in which A1="A", B1="B", C1="C".
B1 is bold. D1 has a formula of =A1&B1&C1 and evaluates as "ABC".
The emboldening of B1 is lost in the calculation of D1.
I can see no way of retaining that emboldening.
I am hoping someone can show me how to retain that formatting or
prove to me that it can't be done. ;)


This will require VBA since formulas only work with values.


Thanks.
I infer you mean event procedures.
I implemented the example worksheet_change example:

Option Explicit

' This example changes the color of changed cells to blue.

Private Sub Worksheet_Change(ByVal Target As Range)
Target.Font.ColorIndex = 5
End Sub

I change B1 from "B" to "D".
B1 is recolored blue.
D1 is recalculated as "ADC", but not recolored.
My understanding is plainly wrong - I've never used event procedures. ;(

The change event "Occurs when cells on the worksheet are changed by the
user or by an external link."

It may be worth trying the calculate event.

Private Sub Worksheet_Calculate()
Stop
End Sub
is triggered.
Private Sub Worksheet_Calculate()
Cells(1, 4).Font.ColorIndex = 5
End Sub
also acts when B1 is changed.
No other worksheet event seems relevant.
I shall post now to see what further help I might get. ;)
--
Walter Briscoe