LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Conditional Formatting

You could use sheet event code.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim cell As Range
For each cell in Me.Range("A1:A100") 'adjust to suit
If Application.IsNumber(cell.Value) Then
Select Case Right(cell.Value, 1)
Case 1
cell.NumberFormat = "##""st"""
Case 2
cell.NumberFormat = "##""nd"""
Case 3
cell.NumberFormat = "##""rd"""
Case Else
cell.NumberFormat = "##""th"""
End Select
End If
Next cell
End Sub

Right-click on the sheet tab and "View Code". Copy/paste the code into that
module.

Edit the range if need be then Alt + q to return to the Excel window.


Gord Dibben MS Excel MVP

On Wed, 31 Dec 2008 17:15:01 -0800, Jokah.D
wrote:

I would like to represent numbers as placements for example: 421 becomes
421st with the "st" in superscript, 32 becomes 32nd with the "nd" in
superscript.

Is there a way to do this in Excel 2007?


 
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
Formatting cells in a column with conditional formatting? shamor Excel Discussion (Misc queries) 8 May 19th 08 10:11 PM
Protect Cell Formatting including Conditional Formatting Mick Jennings Excel Discussion (Misc queries) 5 November 13th 07 05:32 PM
conditional Formatting based on cell formatting Totom Excel Worksheet Functions 3 January 20th 07 02:02 PM
conditional Formatting based on cell formatting Totom Excel Worksheet Functions 0 January 15th 07 04:35 PM
Conditional Formatting that will display conditional data BrainFart Excel Worksheet Functions 1 September 13th 05 05:45 PM


All times are GMT +1. The time now is 10:03 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"