Increase Speed

  • Thread starter Thread starter SIGE_GOEVAERTS
  • Start date Start date
S

SIGE_GOEVAERTS

Hi There,

Normally underneath macro runs quite smoothly.
But sometimes this macro takes ages to complete...not that it bugs but
the calculation speed is like litterally 100 times slower. (for the
same range-sizes!)
All I can do is Close Excel and restart the marco ... to let it run at
normal speed.
Any Ideas? -For Improvement?

Option Explicit

Sub BlanksToNumbers()
Dim r As Range
Dim w As Worksheet
On Error GoTo err
Application.ScreenUpdating = False
For Each w In ActiveWorkbook.Worksheets
For Each r In w.UsedRange.Cells
r.Cells.Font.Name = "Arial"
If r.Text = "" And r.Formula = "" Then r.Value = ""
Next r
Next w
Application.ScreenUpdating = True
err:
End Sub

Cheers, Sige
 
this should change the font for the entire workbook which should be better
than changing part of each worksheet.

Sub changefontinworkbook()
Sheets.Select
Sheets(1).Activate
Cells.Select
With Selection.Font
.Name = "arial"
End With
Range("A1").Select
Sheets(1).Select
End Sub
 
or
Sub chgfontname()
Sheets.Select
Cells.Select
Selection.Font.Name = "arial"
Range("a1").Select
Sheets(1).Select
End Sub
 
or for speed, skip the selecting:

sub chgfontname()
sheets(1).font.name="arial"
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