Assuming all the line formatting is set as per the macro parameters,
then that suggests that the first cell is the only one which is
unlocked.
Check the others, (Format-->Cells Protection Tab) and confirm that
they are all unlocked and if so post back. Otherwise the macro would
appear to be working correctly, i.e only setting a '1' for the only
cell which is unlocked.
HTH
Hi Roger and Richard,
Thank you both for the quick respons. In my macro it doens't really
work as I hoped it to be. When I run this macro he only activates the
first cell and fills in a 1 if it has the beneath conditions. Maybe I'm
doing something wrong. Below is my macro:
Sub oke()
Application.ScreenUpdating = False
ActiveSheet.Unprotect ("arnhem12")
Set d = ActiveCell.CurrentRegion
For Each c In d
If c.Interior.ColorIndex = xlNone And _
c.Borders(xlEdgeLeft).Weight = xlThin And _
c.Borders(xlEdgeLeft).ColorIndex = xlAutomatic And _
c.Borders(xlEdgeTop).LineStyle = xlContinuous And _
c.Borders(xlEdgeTop).Weight = xlThin And _
c.Borders(xlEdgeTop).ColorIndex = xlAutomatic And _
c.Borders(xlEdgeBottom).LineStyle = xlContinuous And _
c.Borders(xlEdgeBottom).Weight = xlThin And _
c.Borders(xlEdgeBottom).ColorIndex = xlAutomatic And _
c.Borders(xlEdgeRight).LineStyle = xlContinuous And _
c.Borders(xlEdgeRight).Weight = xlThin And _
c.Locked = False And _
c.Borders(xlEdgeRight).ColorIndex = xlAutomatic Then
c.Value = 1
End If
Next c
ActiveSheet.Protect ("arnhem12")
MsgBox ("Finished")
Application.ScreenUpdating = True
End Sub
Greetings anita
Roger Govier schreef:
__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________