Script to increase font size of cells

  • Thread starter Thread starter Alan
  • Start date Start date
A

Alan

In Col A starting at cell A1 to A42 I have the numbers (years) 1963 to
2005.

I want to run a macro that will start at the beginning and assign a font
size of 1 to A1 and then 2 to A2 and so on until cell A42 where it finishes
with a font size of 42.

Can anyone help?

TIA, Alan
 
Alan,
I can only get years: 1963 to 2004 in 42 rows.
The code does provide an interesting effect...
'----------------------
Sub StepUpFont()
'Jim Cone - San Francisco, USA - 11/05/2005
Dim rngCell As Excel.Range
Dim lngFont As Long
For Each rngCell In Range("A1:A42")
lngFont = lngFont + 1
rngCell.Font.Size = lngFont
Next 'rngCell
Set rngCell = Nothing
End Sub
'------------------

"Alan" <[email protected]>
wrote in message
In Col A starting at cell A1 to A42 I have the numbers (years) 1963 to
2005.
I want to run a macro that will start at the beginning and assign a font
size of 1 to A1 and then 2 to A2 and so on until cell A42 where it finishes
with a font size of 42.
Can anyone help?
TIA, Alan
 
Hello Alan,

Here is an example...

Code:
--------------------

Sub FontSizes()

Dim R as Long

For R = 1 To 42
Cells(R, "A").Font.Size = R
Next R

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top