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: 21
Default Prevent rows from being selected

I am trying to prevent users from selecting the first 9 rows and row 318 in a
worksheet. Protecting the sheet will not work, because the user needs to be
able to change the width of columns and do other worksheet functions. The
following code only tests for the active cell:

activeRow = ActiveCell.row

If activeRow = 1 Or activeRow = 2 Or activeRow = 3 Or activeRow = 4 Or
activeRow = 5 Or activeRow = 6 Or activeRow = 7 Or activeRow = 8 Or activeRow
= 9 Then
MsgBox ("Sorry, you can not select Rows 1 through 9.")
Range("A10").Select
End If

if activeRow = 318 then
msgbox("Sorry, you can not select Row 318.")
Range("A10").Select
End If

The problem, is that if the user starts in rows 10 or greater and selects
up, they can select into the first 9 rows because the active cell is the
first cell they select. Also, they can start a cell selection at cell 317 and
select through 318. Either of these actions allows for the changing of the
cell data. How can I prevent the selection of these rows?

Thank you for any help you can provide.
--
Markb
 
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
prevent reading or any access to selected cells R New Users to Excel 2 August 26th 09 10:06 PM
Color alternate rows when after hiding selected rows Monk[_2_] Excel Worksheet Functions 6 June 7th 08 01:36 AM
How do I prevent copy and pasting into a selected range of a works oasalako1 Excel Discussion (Misc queries) 1 November 20th 07 01:29 PM
Prevent new pivot table items from being selected Tom Excel Discussion (Misc queries) 3 August 10th 05 05:49 PM
How to prevent deleting certain rows Dory en Ed Excel Programming 1 July 2nd 05 04:48 PM


All times are GMT +1. The time now is 12:38 AM.

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"