Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have the following pulled in from Access to Excel and I need to have it automatically format for a report. This is all in one cell 06Jun for This Many Minutes High/Medium/Low味 1700-2240MDT/2300-0440GMT/0700-1240HKG/1100-1640SYD味 Description (can be a very long description up to 100 characters) The first line up to the box character I want to be 腕egular color index 21. Than on the second line I want the first section before the slash to be 話old, color index 21. Next section after the first slash I want 話old color index 19. After second slash 話old color index 22. After 3rd slash 話old color index 18 length 15. Everything after 腕egular color index 21. So I created below before I knew the 彷irst line was going to be required, but it will not work because the first line does not have a set amount of characters like the second. The range for the first line can be anywhere from 21 to 29 characters. Any ideas? *** FYI, it is not letting me paste that box character in here because as you know it is considered a "return" character. So I pasted in a symbol so you could see what I was. Again all lines are actually in one cell. Here is my original formula: Sub Colors() Dim cel As Range For Each cel In ActiveSheet.Range("f1:f100") If cel.Value < "" Then With Selection.Characters(Start:=1, Length:=15).Font .Name = "Arial" .FontStyle = "bold" .Size = 10 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = 21 End With With Selection.Characters(Start:=16, Length:=15).Font .Name = "Arial" .FontStyle = "bold" .Size = 10 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = 19 End With With Selection.Characters(Start:=31, Length:=15).Font .Name = "Arial" .FontStyle = "bold" .Size = 10 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = 22 End With With Selection.Characters(Start:=46, Length:=15).Font .Name = "Arial" .FontStyle = "bold" .Size = 10 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = 18 End With With Selection.Characters(Start:=60, Length:=155).Font .Name = "Arial" .FontStyle = "Regular" .Size = 10 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = 21 End With End If Next cel End Sub Thank you so much for the help!! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formatting two colors in the same cell | Excel Discussion (Misc queries) | |||
Worksheet formatting (fill colors & text colors) disappeared | Excel Discussion (Misc queries) | |||
Conditional Formatting - more than 4 cell colors | Excel Worksheet Functions | |||
Matching Cell Colors (Cond. Formatting) | Excel Programming | |||
Conditional Formatting Question - Different Cell Colors?? | Excel Discussion (Misc queries) |