joey peanuts
New Member
- Joined
- Mar 20, 2011
- Messages
- 18
I know there has to be a way to clean this up into 1 command instead of selection each cell and locking/unlocking. Any help would be appreciated.
For Each cell In Range("RBARECT_LINE").Cells
If cell.Value <> "" Then
cell.Offset(0, 3).Select
Selection.Locked = False
cell.Offset(0, 4).Select
Selection.Locked = False
cell.Offset(0, 5).Select
Selection.Locked = False
cell.Offset(0, 6).Select
Selection.Locked = False
cell.Offset(0, 11).Select
Selection.Locked = False
cell.Offset(0, 13).Select
Selection.Locked = False
Else
cell.Offset(0, 3).Select
Selection.Locked = True
cell.Offset(0, 4).Select
Selection.Locked = True
cell.Offset(0, 5).Select
Selection.Locked = True
cell.Offset(0, 6).Select
Selection.Locked = True
cell.Offset(0, 11).Select
Selection.Locked = True
cell.Offset(0, 13).Select
Selection.Locked = True
End If
Next cell
For Each cell In Range("RBARECT_LINE").Cells
If cell.Value <> "" Then
cell.Offset(0, 3).Select
Selection.Locked = False
cell.Offset(0, 4).Select
Selection.Locked = False
cell.Offset(0, 5).Select
Selection.Locked = False
cell.Offset(0, 6).Select
Selection.Locked = False
cell.Offset(0, 11).Select
Selection.Locked = False
cell.Offset(0, 13).Select
Selection.Locked = False
Else
cell.Offset(0, 3).Select
Selection.Locked = True
cell.Offset(0, 4).Select
Selection.Locked = True
cell.Offset(0, 5).Select
Selection.Locked = True
cell.Offset(0, 6).Select
Selection.Locked = True
cell.Offset(0, 11).Select
Selection.Locked = True
cell.Offset(0, 13).Select
Selection.Locked = True
End If
Next cell