LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Avoid user to access first two rows in a sheet

To protect the contents of the 2 first rows of an excel sheet, so that
the user cannot change them, I wrote the following code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Row <= 2 Then Cells(3, 1).Select
End Sub

When the user selects a cell or a range which overlaps one of the
first two rows the cell A3 is selected and thus the user cannot change
the contents of the first two rows, I thought :o(

Even with this code the user can change the contents by a double-click
on the header of row 1 or 2 or on a column header.

The code I wrote for this was build up of more than one line in the
beginning, so I thought that a double-click was fast enough to be
interpreted between two lines of the code, but even with this single
line it doesn't work.

I also tried to add Application.Interactive = False but it doesn't
change anything.

All suggestions are welcome!
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Defining user access (via user id) using macros maruko Excel Discussion (Misc queries) 0 July 27th 09 02:44 AM
Protection password iin VBA, how to avoid user seeing it? Afsha Excel Discussion (Misc queries) 2 January 23rd 07 03:06 PM
Avoid user having to enter hours when using [mm]:ss format Lady_luck Excel Discussion (Misc queries) 3 January 4th 05 10:50 AM
Avoid user having to enter 00 hours when using [mm]:ss format Lady Luck Excel Discussion (Misc queries) 4 January 2nd 05 06:56 PM
How to Avoid Printing Blank Rows Yogesh[_3_] Excel Programming 1 November 1st 03 04:52 PM


All times are GMT +1. The time now is 07:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"