View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Steph[_3_] Steph[_3_] is offline
external usenet poster
 
Posts: 312
Default Why won't this loop?

Hello. I have the following code:

Sub CostCenter()
Dim ws As Worksheet

Application.ScreenUpdating = False
For Each ws In Worksheets
If ws.Name < "Consolidate" Then
Set frng = Range("B8:B125")
With frng
.Formula = "=$C$2"
End With
End If
Next ws
Application.ScreenUpdating = True
End Sub

It enters the formula on 1 sheets only, and does not loop through all
worksheets within the workbook except "Consolidate". What am I doing
wrong??