david graham
Active Member
- Joined
- Dec 6, 2007
- Messages
- 345
When i run the code below the "wide cell frame" dissappears. Id i put the pointer over a cell, click on it, & then type, characters appear in the cell but the cell is not framed (you can't tell by looking which cell is selected)
Anyone know how to fix this?
Anyone know how to fix this?
Code:
Sub CLEAR1()
'
' CLEAR GAS
'
'UNPROTECT
Dim IsProtected As Boolean
IsProtected = ActiveSheet.ProtectContents
If IsProtected Then
ActiveSheet.Unprotect
End If
'CLEAR
Dim StartRow&, EndRow&
With Range(ActiveSheet.ScrollArea)
StartRow = .Row: EndRow = .Rows.Count + .Row - 1
End With
Range(Cells(StartRow, (Sheets("POINTS").Range("CW108").Value)), Cells(EndRow, (Sheets("POINTS").Range("CW109").Value))).ClearContents
'CELL CURSOR SELECT
Dim CRng As Object, Cell As Object
Set CRng = Application.Intersect(Range(ActiveSheet.ScrollArea), Columns([POINTs!cw108]))
CRng.Select
For Each Cell In CRng
If Cell.Locked = False Then
Cell.Select
Exit Sub
End If
'PROTECT
If IsProtected Then
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveSheet.EnableSelection = xlUnlockedCells
End If
Next Cell
End Sub