Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Preserving formatting in a formula.
I have a list of shipping codes and descriptions that is referenced in a
template. I need to copy the list and descriptions and add text to the beginning of the description. The formula ="Customer "&B2" does this but I want Customer to be Bold and Red. I tried putting Customer in its own set of cells setting it to Bold, Red and using =B2&" "&C2 but it does not carry over the formatting. How can I do this? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Preserving formatting in a formula.
You need to copy the formulas and paste/special/value elsewhere. The result
will be a text string. You can then format individual characters -- Gary''s Student - gsnu200723 |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Preserving formatting in a formula.
That would be a thought but I would have to highlight the first 10-15 characters of every cell one at a time and change the format.. I would have to do this ~400 times... I just thought there might be an easy way to get the formatting to carry over from one cell to the combined formula.. "Gary''s Student" wrote: You need to copy the formulas and paste/special/value elsewhere. The result will be a text string. You can then format individual characters -- Gary''s Student - gsnu200723 |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Preserving formatting in a formula.
How about changing the values right where they sit.
Select the range and run this macro: Option Explicit Sub testme() Dim myCell As Range Dim myRng As Range Dim myPFX As String myPFX = "Customer: " Set myRng = Nothing On Error Resume Next Set myRng = Intersect(Selection, Selection.Cells.SpecialCells(xlTextValues)) On Error GoTo 0 If myRng Is Nothing Then MsgBox "Select some cells with values!" Exit Sub End If For Each myCell In myRng.Cells With myCell .Value = myPFX & .Text With .Characters(Start:=1, Length:=Len(myPFX)) .Font.ColorIndex = 3 .Font.Bold = True End With End With Next myCell End Sub If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm ..colorindex = 3 is red in my workbook. It doesn't have to be that for your workbook (but probably is). NLiles wrote: That would be a thought but I would have to highlight the first 10-15 characters of every cell one at a time and change the format.. I would have to do this ~400 times... I just thought there might be an easy way to get the formatting to carry over from one cell to the combined formula.. "Gary''s Student" wrote: You need to copy the formulas and paste/special/value elsewhere. The result will be a text string. You can then format individual characters -- Gary''s Student - gsnu200723 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
MS Query from Excel - Preserving formatting, validation and Commen | Excel Discussion (Misc queries) | |||
Preserving Cell References | Excel Discussion (Misc queries) | |||
Preserving customization | Setting up and Configuration of Excel | |||
preserving format in a formula | Excel Worksheet Functions | |||
Preserving Formulas | Excel Discussion (Misc queries) |