Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Cell value specific font size change

Would like to format font size in one column, according to a value in
another, e.g. if I have the data

A B
1 12 X
2 6 Y
3 16 X
4 9 Y
...

I would like the font size of the cells in column B to be the relevant
number in column A

(Going to use wingding arrows in B, but they won't display here)

Thanks,
Geoff.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Cell value specific font size change

For a single cell:

Sub size_it()
Range("B1").Font.Size = Range("A1").Value
End Sub


You can setup a loop to cover the full columns.
--
Gary's Student


"Geoff C" wrote:

Would like to format font size in one column, according to a value in
another, e.g. if I have the data

A B
1 12 X
2 6 Y
3 16 X
4 9 Y
..

I would like the font size of the cells in column B to be the relevant
number in column A

(Going to use wingding arrows in B, but they won't display here)

Thanks,
Geoff.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Cell value specific font size change

Sorry for being dim, but it's the loop I need help with!

"Gary''s Student" wrote:

For a single cell:

Sub size_it()
Range("B1").Font.Size = Range("A1").Value
End Sub


You can setup a loop to cover the full columns.
--
Gary's Student


"Geoff C" wrote:

Would like to format font size in one column, according to a value in
another, e.g. if I have the data

A B
1 12 X
2 6 Y
3 16 X
4 9 Y
..

I would like the font size of the cells in column B to be the relevant
number in column A

(Going to use wingding arrows in B, but they won't display here)

Thanks,
Geoff.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Cell value specific font size change

Hi Geoff:

Sub size_it()
Dim i As Integer
For i = 1 To 10
Cells(i, 2).Font.Size = Cells(i, 1).Value
Next
End Sub

The loop is set up to run over 10 items. This is an example of the
advantage of using CELLS() over RANGE() if you want to process blocks of
cells by row x column.
--
Gary's Student


"Geoff C" wrote:

Sorry for being dim, but it's the loop I need help with!

"Gary''s Student" wrote:

For a single cell:

Sub size_it()
Range("B1").Font.Size = Range("A1").Value
End Sub


You can setup a loop to cover the full columns.
--
Gary's Student


"Geoff C" wrote:

Would like to format font size in one column, according to a value in
another, e.g. if I have the data

A B
1 12 X
2 6 Y
3 16 X
4 9 Y
..

I would like the font size of the cells in column B to be the relevant
number in column A

(Going to use wingding arrows in B, but they won't display here)

Thanks,
Geoff.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Cell value specific font size change

Hi Geoff

You can try this event in the sheet module
If you fill in a number in A the font change in B

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Range("A:A"), Target) Is Nothing Then
If IsNumeric(Target) Then
Target.Offset(0, 1).Font.Size = Target.Value
End If
End If
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Geoff C" wrote in message ...
Would like to format font size in one column, according to a value in
another, e.g. if I have the data

A B
1 12 X
2 6 Y
3 16 X
4 9 Y
..

I would like the font size of the cells in column B to be the relevant
number in column A

(Going to use wingding arrows in B, but they won't display here)

Thanks,
Geoff.





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Cell value specific font size change

Hi Geoff,

Try:

'=============
Public Sub Tester()
Dim SH As Worksheet
Dim rng As Range
Dim rCell As Range

Set SH = Sheets("Sheet1") '<<==== CHANGE
Set rng = SH.Range("B1:B10") '<<==== CHANGE

For Each rCell In rng.Cells
With rCell
.Font.Size = .Offset(0, -1).Font.Size
End With
Next rCell

End Sub
'<<=============


---
Regards,
Norman



"Geoff C" wrote in message
...
Would like to format font size in one column, according to a value in
another, e.g. if I have the data

A B
1 12 X
2 6 Y
3 16 X
4 9 Y
..

I would like the font size of the cells in column B to be the relevant
number in column A

(Going to use wingding arrows in B, but they won't display here)

Thanks,
Geoff.



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Cell value specific font size change

Hi Geoff.

Reading more carefully, change:

.Font.Size = .Offset(0, -1).Font.Size


to

.Font.Size = .Offset(0, -1).Value


If, however, you wish the font size to respond dynamically to changes in
column A values, try instead Ron de Bruin's suggestion.


---
Regards,
Norman



"Norman Jones" wrote in message
...
Hi Geoff,

Try:

'=============
Public Sub Tester()
Dim SH As Worksheet
Dim rng As Range
Dim rCell As Range

Set SH = Sheets("Sheet1") '<<==== CHANGE
Set rng = SH.Range("B1:B10") '<<==== CHANGE

For Each rCell In rng.Cells
With rCell
.Font.Size = .Offset(0, -1).Font.Size
End With
Next rCell

End Sub
'<<=============


---
Regards,
Norman



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Cell value specific font size change

Thanks to all of you for your suggestions. Not only is my request answered,
I've learnt about seven other things!

"Geoff C" wrote:

Would like to format font size in one column, according to a value in
another, e.g. if I have the data

A B
1 12 X
2 6 Y
3 16 X
4 9 Y
..

I would like the font size of the cells in column B to be the relevant
number in column A

(Going to use wingding arrows in B, but they won't display here)

Thanks,
Geoff.

Reply
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
change font size on screen, but prints in old size lvrcdval Excel Discussion (Misc queries) 2 July 19th 07 02:36 PM
When I change the font size in a cell the value changes. Value increases with increase in font. Excel Worksheet Functions 5 June 28th 07 11:00 PM
How to change Font size based upon cell input Ashley McKay Excel Discussion (Misc queries) 5 March 23rd 07 06:44 PM
Change all text one font size up with various font sizes used. omchrystal New Users to Excel 2 March 6th 07 09:01 PM
change font size and bold in cell? R Doornbosch Excel Programming 7 February 10th 04 12:03 AM


All times are GMT +1. The time now is 03:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"