Hi How are you?
How do I format just part of the text obtained from the CONCATENATE function for example if I want the word Maria is in bold and the profession is in italics.
I have put into practice the conditional formatting but I formatted the entire cell.
I add a file that serves as an example.
Thank you very much for your help.
JuanM.
I'm afraid you can't format part of the results of a formula different to the rest.
Dom
"May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."
Use code tags when posting your VBA code: [code] Your code here [/code]
Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.
Through VBA you can not or using another technique?
Thanks
Regards,
Try this:
Sub test() Dim lngLoopRow As Long Dim lngLastRow As Long lngLastRow = Cells(Rows.Count, 2).End(xlUp).Row For lngLoopRow = 3 To lngLastRow With Range("F" & lngLoopRow) .Value = Range("B" & lngLoopRow) & " " & Range("C" & lngLoopRow) & " tiene " & _ Range("D" & lngLoopRow) & " años y su profesión es " & Range("E" & lngLoopRow) With .Characters(Start:=1, Length:=Len(Range("B" & lngLoopRow) & " " & Range("C" & lngLoopRow))).Font .FontStyle = "Bold" End With With .Characters(Start:=Len(.Value) - Len(Range("E" & lngLoopRow)) + 1, Length:=Len(Range("E" & lngLoopRow))).Font .FontStyle = "Italic" End With End With Next lngLoopRow End Sub
Dom
Last edited by Domski; 12-14-2010 at 11:46 AM.
"May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."
Use code tags when posting your VBA code: [code] Your code here [/code]
Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.
Dom hello thank you very much for the reply.
The code works very well, there would be some way that will not erase the arguments of the concatenate function?
Add the file to see that when I run the macro deletes the function arguments.
Thank you very much for your help.
Greetings
No, the only way is to do the whole thing including the concatenation using VBA.
As I said it's not possible to format the result of a formula differently, you can only do this with fixed text strings.
Dom
"May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."
Use code tags when posting your VBA code: [code] Your code here [/code]
Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.
Thanks for your answer.
Best regards,
JuanM
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks