wide cell frame disappears after i run macro

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?





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
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

Forum statistics

Threads
1,203,321
Messages
6,054,719
Members
444,746
Latest member
Emre06

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top