View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Andy Andy is offline
external usenet poster
 
Posts: 414
Default Changing cell value in a range terminates code execution

I tried two different ways of changing cell values and attributes as follows:

1) For Rw = 4 To 12
For Cm = 2 To 10
Cells(Rw, Cm).Value = 0
Cells(Rw, Cm).Font.Size = 24
Cells(Rw, Cm).Font.ColorIndex = 1
Next Cm
Next Rw

2) For Each c In Worksheets("Sheet1").Range("B4:J12")
c.Value = 0
c.Font.Size = 24
c.Font.ColorIndex = 1
Next c

Both are straight out of Excel VB help. Execution of both terminate
immediately after the value of the first cell is changed, with no error
message. If I comment out the .value statements, they both run fine. Cells
formatted as Number.

Has anybody run into this before ? What am I missing ?