PC Review


Reply
Thread Tools Rate Thread

CellPointer (rectangle around selected cell) not visible

 
 
Henk
Guest
Posts: n/a
 
      28th May 2009
To make some data input sheets more user friendly, I created the possibility
for the user to choose whether he may select locked cells or not. To disable
the access of locked cells I wrote the following code :

Public Sub InputModeLock()

Application.ScreenUpdating = False

Dim BackSheet As String
Dim BackCell As String
Dim BackCellFound As Boolean
Dim StartCell As String

BackSheet = ActiveSheet.Name
BackCellFound = False
StartCell = ActiveCell.Address

If ActiveCell.Locked = True Then ' Just to direct the CellPointer to an
unlocked cell

Do While ActiveCell.Row > 11
ActiveCell.Offset(-1, 0).Range("A1").Select
If ActiveCell.Locked = False Then
BackCell = ActiveCell.Address
BackCellFound = True
Exit Do
End If
Loop

If BackCellFound = False Then
Range(StartCell).Select
Do While ActiveCell.Row < 100
ActiveCell.Offset(1, 0).Range("A1").Select
If ActiveCell.Locked = False Then
BackCell = ActiveCell.Address
BackCellFound = True
Exit Do
End If
Loop
End If

Else

BackCellFound = True
BackCell = ActiveCell.Address

End If

ActiveSheet.Unprotect Password:="xxxx"
Range("A2502").Value = True
ActiveSheet.Shapes("InputLocked").Select
Selection.Delete
Sheets("Globals").Select
ActiveSheet.Unprotect Password:="xxxx"
Range("InputModeUnlocked").Select
Selection.Copy
Sheets(BackSheet).Select
ActiveSheet.Paste
If BackCellFound = True Then
Range(BackCell).Select
End If
ActiveSheet.EnableSelection = xlUnlockedCells
ActiveSheet.Protect Password:="xxxx"

End Sub

This works okay, but preparing the file for the user I run some code to
protect, hide, reformat ecetera etcetera. To put all sheets where appliccable
in locked position, I call the InputModeLock routine. Which again works
perfectly. The only thing is that my CellPointer (the rectangle around a
selected cell) is gone. In the upper left corner of my screen, where the
selected cell address or name is displayed, I can see that I can select the
unlocked cells, but I do not see the CellPointer. The moment I input anything
in an unlocked cell, which is possible, then the CellPointer is back
immediately.

The code calling InputModeLock routine is :

Sheets("Sheet x").Select
Rows("500:5000").Select
Selection.EntireRow.Hidden = True
ActiveWindow.DisplayHeadings = False
ActiveWindow.DisplayGridlines = False
If Range("A2502").Value = False Then
Call InputModeLock
End If

Anyone any clue?

Thanks in advance,

Henk



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CellPointer (rectangle around selected cell) invisible Henk Microsoft Excel Programming 2 8th Jun 2009 04:02 PM
Ensuring Selected Cell is Visible on Screen ZipCurs Microsoft Excel Programming 7 23rd Mar 2008 06:47 PM
Rectangle not visible Peter Microsoft C# .NET 3 6th Mar 2006 08:29 AM
scroll window to display selected cell in visible area? Kate Microsoft Excel Programming 5 3rd Jan 2006 03:38 PM
Drop-down arrow only visible when cell selected John Richards Microsoft Excel Discussion 2 4th Mar 2005 11:40 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:00 AM.