|
-
Jan 11th, 2002, 02:19 PM
#1
Thread Starter
Addicted Member
Bold in Excel
Hi,
In Excel, is it possible to bold only a part of a sentence? I mean, I know it's possible when in the cell there's NO =
="Suite à cette analyse, nous sommes d'opinion que la "&'Saisie rapport'!B20&" de cette propriété, en date du "&CTXT(JOUR(('Saisie rapport'!B5));0;VRAI)&" "&RECHERCHEV(MOIS(('Saisie rapport'!B5));Feuil1!K1:Feuil1!L12;2)&" "&CTXT(ANNEE(('Saisie rapport'!B5));0;VRAI)&" est de "&Feuil1!H28&" $. « "&Feuil1!K34&" »"
This is a big sentence in one of the cell. But the problem is that I want to bold or underline just a part of the cell. It is suppose to give something like this :
Suite à cette analyse, nous sommes d'opinion que la VALEUR MARCHANDE PROBABLE de cette propriété, en date du 12 octobre 2001 est de 330500 $. « TROIS CENT TRENTE MILLE CINQ CENTS »
I want to bold only the 12 octobre 2001. Is it possible in VBA? How?
Thanks
Ça l'air que baiser enlève les maux de tête! Baisons!
On se mets-tu tout nu?
-
Jan 12th, 2002, 07:02 PM
#2
You will need to use the Characters property. The VBA recorder doesn't seem to like recoding changes to this property. You will need to pass the Start and Length of the Characters that you want formatted. So, you might want to assign the first part of your string to a variable so that you can check it's length to know where to start formatting:
VB Code:
Dim sMyDate As String
Dim sMyText As String
sMyDate = "12 octobre 2001"
sMyText = "Suite à cette analyse, nous etc... "
With Worksheets("Sheet1").Range("A12")
.Value = sMyText & sMyDate & " blah blah blah"
.Characters(Len(sMyText) + 1, Len(sMyDate)).Font.Bold = True
End With
-
Jan 14th, 2002, 09:05 AM
#3
Thread Starter
Addicted Member
Hi,
Ok, what about if I want to put that in bold? Is it possible? : "&RECHERCHEV(MOIS(('Saisie rapport'!B5));Feuil1!K1:Feuil1!L12;2)&" "&CTXT(ANNEE(('Saisie rapport'!B5));0;VRAI)&" (it gaves 12 octobre 2001)...
Thanks!
Mel
Ça l'air que baiser enlève les maux de tête! Baisons!
On se mets-tu tout nu?
-
Jan 14th, 2002, 10:41 PM
#4
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|