Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 ? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
Works for me. Are you in break mode in the editor maybe or something like that? Try Run, Reset and Debug, Clear Breakpoints. regards Paul Andy wrote: 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 ? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Options | Excel Discussion (Misc queries) | |||
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing | Excel Discussion (Misc queries) | |||
code execution has been interrupted | Excel Discussion (Misc queries) | |||
Changing query execution sequence | Excel Discussion (Misc queries) | |||
Automatic Macro Execution Upon Cell Values Changing | Excel Programming |