2 sperate Font sizes in the same cell

mingandmong

Active Member
Joined
Oct 15, 2014
Messages
336
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
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
32,323
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
336
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
32,323
Office Version
365
Platform
Windows
Glad we could help & thanks for the feedback
 

FracinDean

Board Regular
Joined
Jul 11, 2011
Messages
65
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
32,323
Office Version
365
Platform
Windows
Glad it helped you & thanks for the feedback
 

Forum statistics

Threads
1,082,333
Messages
5,364,675
Members
400,810
Latest member
elbashka

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top