Keep formatting and custom formulas.

Tsorraught

New Member
Joined
Oct 26, 2010
Messages
7
I have a couple of arrays of cells that have two different text formats and are being put into the same relative cell via "=A1&B1" but "A1" is bold and "B1" is not. I want to keep the bold on "A1" and keep "B1" not bold. Can someone help me accomplish this if it is possible with a custom function (prefered) or some other means?
 

Sandeep Warrier

Board Regularmmmm Pizza
Joined
Oct 31, 2008
Messages
2,672
Hi

You cannot do this using regular formulae. You will need code to do this.

For example, if A1 is bold, B1 is regular and C1 = A1 & B1, then try

<font face=Courier New><SPAN style="color:#00007F">Sub</SPAN> Test()<br>    <SPAN style="color:#00007F">With</SPAN> Range("C1")<br>        .Value = Range("A1").Value & Range("B1").Value<br>        .Characters(Start:=1, Length:=Len(Range("A1").Value)).Font.Bold = <SPAN style="color:#00007F">True</SPAN><br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">With</SPAN><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br></FONT>
 

Forum statistics

Threads
1,081,518
Messages
5,359,237
Members
400,523
Latest member
ExcelNewbie98

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top