Macro running slow after adding a range in name manager

mingandmong

Active Member
Joined
Oct 15, 2014
Messages
339
Hi im running excel 2010

i have a small macro that changes the font size in coulumn "K" and runs fine

After adding 4 ranges in the name manager which is a index match formula and has no referance to the cells in column "K" the macro runs at a snails pace i delete the ranges and the macro runs as it should any ideas

The 4 ranges are
=INDEX('Core Lables'!$AW$2:$AW$3,MATCH('Core Lables'!$H$2,'Core Lables'!$AV$2:$AV$3,0))
=INDEX('Core Lables'!$AW$2:$AW$3,MATCH('Core Lables'!$H$3,'Core Lables'!$AV$2:$AV$3,0))
=INDEX('Core Lables'!$AW$2:$AW$3,MATCH('Core Lables'!$H$4,'Core Lables'!$AV$2:$AV$3,0))
=INDEX('Core Lables'!$AW$2:$AW$3,MATCH('Core Lables'!$H$5,'Core Lables'!$AV$2:$AV$3,0))

The macro is

Sub FontSize()

Dim Cl As Range

For Each Cl In Range("k2", Range("k" & Rows.Count).End(xlUp))
With Cl
.Value = .Value
.Font.Name = "Arial"
.Font.Size = 20
.Characters(1, 1).Font.Size = 99
End With
Next Cl

End Sub
 

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.
Check whether settinng calculation to manual makes any difference.
You don't need a loop :
Code:
Sub FontSize()
Application.Calculation = xlCalculationManual
With Range("k2", Range("k" & Rows.Count).End(xlUp))
    .Value = .Value
    .Font.Name = "Arial"
    .Font.Size = 20
    .Characters(1, 1).Font.Size = 99
End With
Application.Calculation = xlCalculationAutomatic
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,958
Messages
6,175,627
Members
452,661
Latest member
Nonhle

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