2 sperate Font sizes in the same cell

mingandmong

Active Member
Joined
Oct 15, 2014
Messages
339
Hi Dave changed the sheet name, and still can not run as a macro.. i open up the macro and its empty?
also the code being specific would need to change November was an example the other rows below are charlie, foxtrot, yankee zulu ect..ect
 

Some videos you may like

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
40,820
Office Version
365
Platform
Windows
Hi Fluff thankyou for your hard work.. the result is what i wanted, but it deletes my formula's in column j so i cannot use the same rows again
i will post another example there may be annother way to get my desired results thanks once again
AFAIK there is no way of doing what you want if the cell contains a formula. Which is why I converted the formula into values.
 

mingandmong

Active Member
Joined
Oct 15, 2014
Messages
339
Thank-you Fluff for all your help,
Its working fine... i just copy and paste column "J" with the origanal formula's via another macro after every time i run your macro
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
40,820
Office Version
365
Platform
Windows
Glad we could help & thanks for the feedback
 

FracinDean

Board Regular
Joined
Jul 11, 2011
Messages
94
You cannot do that via a formula, but this macro should do what you want
Code:
Sub FontSize()
   
   Dim Cl As Range
   
   For Each Cl In Range("J2", Range("J" & Rows.Count).End(xlUp))
      With Cl
         .Value = .Value
         .Font.Name = "Arial"
         .Font.size = 20
      .Characters(1, 1).Font.size = 128
      End With
   Next Cl
   
End Sub
Thank you for this very useful code Fluff. I have always wanted to be able to change the font of part of a cell's contents using code, and the .Characters attribute is the magic piece I needed. Below is an example where I used it to subscript part of a cell. I think I will be able to generalize it by making the starting cell and ending cell parameters in the function, and maybe also using a parameter for what I want to change (subscript or superscript etc.0. Very helpful!

Code:
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]Dim Cl As Range
For Each Cl In Range("rType")
With Cl
   .Characters(13, 17).Font.Subscript = True
End With
Next Cl
[/FONT]
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
40,820
Office Version
365
Platform
Windows
Glad it helped you & thanks for the feedback
 

Watch MrExcel Video

Forum statistics

Threads
1,099,290
Messages
5,467,779
Members
406,551
Latest member
brennermac

This Week's Hot Topics

Top