Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
worksheetfunction.text() and text colour
I know worksheetfunction.text is used to set number format. Can it be used to
set font color as well. Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
worksheetfunction.text() and text colour
Or to be more specific. I need this code to operate so that the font color is
changed before the time is written or the time is written in red/blue straight up. At the moment it is writing it in black first and this is causing me an error in another part of the workbook. If RiderNo = 1 Then Sheets("Ironman").Cells(RiderCell.Row, Columns.Count).End(xlToLeft).Offset(0, 1).Font.ColorIndex = 3 Sheets("Ironman").Cells(RiderCell.Row, Columns.Count).End(xlToLeft).Offset(0, 1).NumberFormat = "[hh]:mm:ss" Sheets("Ironman").Cells(RiderCell.Row, Columns.Count).End(xlToLeft).Offset(0, 1) = WorksheetFunction.Text(Sheets("Running Sheet").Cells(TRow, 4), "[hh]:mm:ss") 'calculates place for this lap Sheets("Ironman").Cells(RiderCell.Row, Columns.Count).End(xlToLeft).Offset(0, 1) = WorksheetFunction.Max(Sheets("Ironman").Columns(Sh eets("Ironman").Cells(RiderCell.Row, Columns.Count).End(xlToLeft).Offset(0, 1).Column)) + 1 ElseIf RiderNo = 2 Then Sheets("Ironman").Cells(RiderCell.Row, Columns.Count).End(xlToLeft).Offset(0, 1).Font.ColorIndex = 5 Sheets("Ironman").Cells(RiderCell.Row, Columns.Count).End(xlToLeft).Offset(0, 1).NumberFormat = "[hh]:mm:ss" Sheets("Ironman").Cells(RiderCell.Row, Columns.Count).End(xlToLeft).Offset(0, 1) = WorksheetFunction.Text(Sheets("Running Sheet").Cells(TRow, 4), "[hh]:mm:ss") Sheets("Ironman").Cells(RiderCell.Row, Columns.Count).End(xlToLeft).Offset(0, 1) = WorksheetFunction.Max(Sheets("Ironman").Columns(Sh eets("Ironman").Cells(RiderCell.Row, Columns.Count).End(xlToLeft).Offset(0, 1).Column)) + 1 End If "NDBC" wrote: I know worksheetfunction.text is used to set number format. Can it be used to set font color as well. Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
worksheetfunction.text() and text colour
It was a protected worksheet problem. I hope I didn't waste too many peoples
time. Thanks "NDBC" wrote: Or to be more specific. I need this code to operate so that the font color is changed before the time is written or the time is written in red/blue straight up. At the moment it is writing it in black first and this is causing me an error in another part of the workbook. If RiderNo = 1 Then Sheets("Ironman").Cells(RiderCell.Row, Columns.Count).End(xlToLeft).Offset(0, 1).Font.ColorIndex = 3 Sheets("Ironman").Cells(RiderCell.Row, Columns.Count).End(xlToLeft).Offset(0, 1).NumberFormat = "[hh]:mm:ss" Sheets("Ironman").Cells(RiderCell.Row, Columns.Count).End(xlToLeft).Offset(0, 1) = WorksheetFunction.Text(Sheets("Running Sheet").Cells(TRow, 4), "[hh]:mm:ss") 'calculates place for this lap Sheets("Ironman").Cells(RiderCell.Row, Columns.Count).End(xlToLeft).Offset(0, 1) = WorksheetFunction.Max(Sheets("Ironman").Columns(Sh eets("Ironman").Cells(RiderCell.Row, Columns.Count).End(xlToLeft).Offset(0, 1).Column)) + 1 ElseIf RiderNo = 2 Then Sheets("Ironman").Cells(RiderCell.Row, Columns.Count).End(xlToLeft).Offset(0, 1).Font.ColorIndex = 5 Sheets("Ironman").Cells(RiderCell.Row, Columns.Count).End(xlToLeft).Offset(0, 1).NumberFormat = "[hh]:mm:ss" Sheets("Ironman").Cells(RiderCell.Row, Columns.Count).End(xlToLeft).Offset(0, 1) = WorksheetFunction.Text(Sheets("Running Sheet").Cells(TRow, 4), "[hh]:mm:ss") Sheets("Ironman").Cells(RiderCell.Row, Columns.Count).End(xlToLeft).Offset(0, 1) = WorksheetFunction.Max(Sheets("Ironman").Columns(Sh eets("Ironman").Cells(RiderCell.Row, Columns.Count).End(xlToLeft).Offset(0, 1).Column)) + 1 End If "NDBC" wrote: I know worksheetfunction.text is used to set number format. Can it be used to set font color as well. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Text format - setting text colour with code | Excel Discussion (Misc queries) | |||
Is there a VBA Function for WorksheetFunction.Text? | Excel Programming | |||
Find WorksheetFunction - finding text within text | Excel Programming | |||
Unable to get the Text property of the WorksheetFunction class | Excel Programming | |||
Text in Blue colour, but print in black colour | Excel Worksheet Functions |