Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
prevent reading or any access to selected cells | New Users to Excel | |||
Color alternate rows when after hiding selected rows | Excel Worksheet Functions | |||
How do I prevent copy and pasting into a selected range of a works | Excel Discussion (Misc queries) | |||
Prevent new pivot table items from being selected | Excel Discussion (Misc queries) | |||
How to prevent deleting certain rows | Excel Programming |