Different font size, same cell, changing text only, vba

DPARDY

New Member
Joined
Dec 3, 2009
Messages
41
Office Version
  1. 365
Platform
  1. Windows
Thank you for your time,

In cell A1 is pasted values form concat of cells A2 & A3. Both A2 & A3 text will be changing all the time, what I need to do is only decrease the font size of the text that comes from A3.

Thanks Again.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
You should post examples of before and after when you have a question like this. I could interpret that the text to be changed is in A3, or it is in A1. Still, what you ask might be rather difficult. Once the font has been decreased, how would anyone stop it from decreasing again if there is another paste action. That tells me you also need to explain what you are doing.
 
Upvote 0
1675015002922.png
 
Upvote 0
Not sure what will work because A1 is the result of a formula and is not a cell value. Will have to play around.
FWIW, I had it working when A1 was not a formula but not now. Can only imagine that is the problem.
 
Last edited:
Upvote 0
Not sure what will work because A1 is the result of a formula and is not a cell value. Will have to play around.
FWIW, I had it working when A1 was not a formula but not now. Can only imagine that is the problem.
A5 is just text now, that's the cell I need to change the font size.
 
Upvote 0
then perhaps this will work for you
VBA Code:
Sub testFontSize()
Dim intSize As Integer

intSize = Range("A1").Characters(1, Len(Range("A2"))).Font.Size
Range("A1").Characters(Len(Range("A2")) + 1).Font.Size = intSize - 2


End Sub
 
Upvote 0
I reviewed your posts again and don't see where you said you wanted font size to change in A5. So change A1 to A5?
Range("A5").Characters(Len(Range("A2")) + 1).Font.Size = intSize - 2
 
Upvote 0
Solution
I reviewed your posts again and don't see where you said you wanted font size to change in A5. So change A1 to A5?
Range("A5").Characters(Len(Range("A2")) + 1).Font.Size = intSize - 2
PERFECT, Thank you so much.
 
Upvote 0
Glad it worked. Thanks for the recognition.
 
Upvote 0

Forum statistics

Threads
1,215,453
Messages
6,124,920
Members
449,195
Latest member
Stevenciu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top