Active Cell Indicator Disappearing

hotabae

Board Regular
Joined
Apr 18, 2018
Messages
167
Hello!

I've had an issue plaguing me for a while now;

Most of the time, when I open my workbook, the highlighted border around my active cell disappears.

3J3UPxE.png


I suspect that it is caused by my workbook_open() code, but any time I try to debug it, the issue goes away.

Whenever I open the workbook, I reset the user-interface-only protection for each sheet within the document.

My _open code is as follows:

Code:
Private Sub workbook_Open()


Dim wSheetName As Worksheet
For Each wSheetName In Worksheets
    wSheetName.Protect Password:=”password”, UserInterFaceOnly:=True
    wSheetName.EnableSelection = xlUnlockedCells
Next wSheetName


Sheets("Cover").Range("C26").Activate


If Not ActiveWindow.View = xlNormalView Then
ActiveWindow.View = xlNormalView
End If


End Sub

Additionally, I have this code on one of the sheets affected by the protection:

Code:
Private Sub Worksheet_Activate()


ActiveSheet.Cells(1, 1).Select


End Sub

Does anyone have an idea for the reason my active cell indicator is missing?

I can "fix" it by changing tabs, maximizing/minimizing, clicking into the vba editor, and a few other ways, but it must be done manually. If I try to force one of these methods programmatically, it proves to be ineffective.

If I place this statement (shown below) in my code, it reveals my screen updating is turned on (true) during startup:

Code:
Debug.Print(Application.ScreenUpdating)

Thanks!
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
When you activate that sheet, it's selecting Cell A1....have you looked up there for your "selection box" (or whatever you want to call it :) ) .

Can you live without the... ActiveSheet.Cells(1,1). Select ...line?
 
Upvote 0
Thanks for the response!

As far as excel is concerned, the correct box is selected. (you can even see the correct cell labels are active)

If I were to start typing right after opening, the characters would appear in the "Attn:" field as expected.

I removed the other worksheet's code for good measure, and the indicator is still missing.

Removed this:
Code:
[LEFT][COLOR=#333333][FONT=monospace]ActiveSheet.Cells(1, 1).Select[/FONT][/COLOR][/LEFT]

It appears to be a completely visual bug.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,170
Members
453,021
Latest member
Justyna P

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