Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Assign a Colour to part of a Cells Text?
I'm creating a label in e.g Cell A1 using
'Build Label SpecialLabel = SchoolName & vbLf & _ Zone & vbLf & vbLf & _ TeacherName & vbLf & _ ClassTime IS it possible to assign a colour to just the first line "SchoolName"??? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Assign a Colour to part of a Cells Text?
Hi HotRod
You can use Characters Start and length Range("A1").Value = "Hi There" Range("A1").Characters(Start:=1, Length:=2).Font.ColorIndex = 3 -- Regards Ron de Bruin http://www.rondebruin.nl "HotRod" wrote in message ... I'm creating a label in e.g Cell A1 using 'Build Label SpecialLabel = SchoolName & vbLf & _ Zone & vbLf & vbLf & _ TeacherName & vbLf & _ ClassTime IS it possible to assign a colour to just the first line "SchoolName"??? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Assign a Colour to part of a Cells Text?
I found this in help.
Try this for starters With ActiveSheet.Range("G1") .Value = SpecialLabel .Characters(Start:=1, Length:=Len(SchoolName)).Font.ColorIndex = 3 End With -- My handle should tell you enough about me. I am not an MVP, expert, guru, etc. but I do like to help. "HotRod" wrote in message ... I'm creating a label in e.g Cell A1 using 'Build Label SpecialLabel = SchoolName & vbLf & _ Zone & vbLf & vbLf & _ TeacherName & vbLf & _ ClassTime IS it possible to assign a colour to just the first line "SchoolName"??? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Assign a Colour to part of a Cells Text?
Sub BBB()
SchoolName = "the big brown school" Zone = "Elba" TeacherName = "Sally Slewfer" ClassTime = "8:30 AM" SpecialLabel = SchoolName & vbLf & _ Zone & vbLf & vbLf & _ TeacherName & vbLf & _ ClassTime Range("A1").Font.ColorIndex = xlAutomatic Range("A1").Value = SpecialLabel Range("A1").Characters(1, Len(SchoolName)).Font.ColorIndex = 3 End Sub -- Regards, Tom Ogilvy "HotRod" wrote in message ... I'm creating a label in e.g Cell A1 using 'Build Label SpecialLabel = SchoolName & vbLf & _ Zone & vbLf & vbLf & _ TeacherName & vbLf & _ ClassTime IS it possible to assign a colour to just the first line "SchoolName"??? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Assign a Colour to part of a Cells Text?
THANK YOU VERY MUCH
"HotRod" wrote in message ... I'm creating a label in e.g Cell A1 using 'Build Label SpecialLabel = SchoolName & vbLf & _ Zone & vbLf & vbLf & _ TeacherName & vbLf & _ ClassTime IS it possible to assign a colour to just the first line "SchoolName"??? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
assign values to specific cells in an excel sheet through text file | Excel Discussion (Misc queries) | |||
Assign Values to text cells | Excel Discussion (Misc queries) | |||
Assign a Value if Some of the Text in 2 Cells are the Same | Excel Discussion (Misc queries) | |||
how do I assign a symbol to the result of a part of a nested IF s. | Excel Worksheet Functions | |||
Need Excel to read a text field(part#) and assign a number(commiss | Excel Programming |