Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 204
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 204
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 204
Default 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
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
Text format - setting text colour with code NDBC Excel Discussion (Misc queries) 6 July 1st 09 10:15 PM
Is there a VBA Function for WorksheetFunction.Text? Dennis Excel Programming 4 November 30th 06 03:56 PM
Find WorksheetFunction - finding text within text Marcotte A Excel Programming 1 January 24th 05 10:16 PM
Unable to get the Text property of the WorksheetFunction class John[_86_] Excel Programming 5 November 25th 04 01:40 AM
Text in Blue colour, but print in black colour wuwu Excel Worksheet Functions 1 November 13th 04 02:36 PM


All times are GMT +1. The time now is 05:27 AM.

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"