Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
automatic font change
How can I make the last two digits in a cell automatically change to
superscript and underline? I want to be able to enter 4 or 5 numbers and have the last two change automatically in certain cells only. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
automatic font change
I have a question for you ... What is it for you that triggers the automatic change ? or What is the unique identifier of these cells where you would like the change to be automatic ? Carim -- Carim ------------------------------------------------------------------------ Carim's Profile: http://www.excelforum.com/member.php...o&userid=33259 View this thread: http://www.excelforum.com/showthread...hreadid=531254 |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
automatic font change
First, this kind of formatting doesn't work with formulas or numbers--but it
will work if you treat your numbers as text (prefix the entry with an apostrophe (') or preformat the cell as text. So if you want to use this cell in further calculations, I wouldn't do this. (It looks kind of like you're writing a check???) And the underscore doesn't move directly under the superscripted characters--it's still at the bottom of the cell. But if you still want... rightclick on the worksheet tab that should have this behavior. Select view code. Paste this into the code window that just opened up. Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) With Target If .Cells.Count 1 Then Exit Sub If Intersect(.Cells, Me.Range("c:c")) Is Nothing Then Exit Sub If Application.IsNumber(.Value) Then Exit Sub If IsNumeric(.Value) Then With .Characters(Start:=Len(.Value) - 1, Length:=2).Font .Superscript = True .Underline = xlUnderlineStyleSingle End With End If End With End Sub This code looks for changes in column C (modify to what you want). And delete that ".underline = ..." line????? You could even enter the values as numbers and have the code convert it to text. L Scholes wrote: How can I make the last two digits in a cell automatically change to superscript and underline? I want to be able to enter 4 or 5 numbers and have the last two change automatically in certain cells only. -- Dave Peterson |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
automatic font change
I am a traffic accident investigator and I am using excel to transcribe
handwritten measurements for legible printing. The format used is to write the feet in normal script and the inches in underlined superscript. Nothing happens with these numbers except for printing. (Sometimes I have thousands of measurements to transcribe, so a macro will make entering them much easier.) I have tried your code, but it doesn't seem to work. The cells, "C5:D60" are merged (i.e., C5,C6 is one, D5,D6 is another, etc.) in both columns. Should I unmerge the cells, or is there a way to make this work? Thanks for all the help. BTW, it doesn't matter how the cell is formated, text or numbers, it's the appearance that matters. Thanks for all of your help! |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
automatic font change
Hi, YES ... forget about merged cells they are a real nuisance when it comes to programming ... Then have a go with Dave's recommendation ... Given his level of expertise, I would be surprised if you had any problems with his code. Cheers Carim -- Carim ------------------------------------------------------------------------ Carim's Profile: http://www.excelforum.com/member.php...o&userid=33259 View this thread: http://www.excelforum.com/showthread...hreadid=531254 |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
automatic font change
His works perfectly without merged cells! Thanks for your help!
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Is it possible to change the default font in Excel comments? | Excel Discussion (Misc queries) | |||
Event Macro adjustment needed - need to change font color also | Excel Worksheet Functions | |||
how do i change the font size in a combo box? | Excel Worksheet Functions | |||
Moving Excel Charts into Word Documents: font sizes change | Charts and Charting in Excel | |||
Change datalabel font size for all chartobjects in a row | Charts and Charting in Excel |