Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 147
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 147
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
assign values to specific cells in an excel sheet through text file s_pushparaj Excel Discussion (Misc queries) 2 May 11th 08 10:09 PM
Assign Values to text cells Josh Excel Discussion (Misc queries) 4 January 16th 07 02:44 PM
Assign a Value if Some of the Text in 2 Cells are the Same Blobbies Excel Discussion (Misc queries) 5 February 10th 06 02:02 AM
how do I assign a symbol to the result of a part of a nested IF s. Lee Mitchell Excel Worksheet Functions 1 March 30th 05 05:32 PM
Need Excel to read a text field(part#) and assign a number(commiss sstanton33 Excel Programming 1 March 18th 05 04:08 AM


All times are GMT +1. The time now is 08:00 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"