Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Protecting a Used Range
My code inserts multiple columns in various places, adds some vlookup and
then selects the used range (which ends up to be Columns A-U, Rows A through 'varies each time'). I'm struggling with how to do the following: 1) Allow the user to enter any data they want outside of the used range (i.e., after the last row/column with an entry. 2) Protect Columns A:J and L:U (and their associated rows) in the used range from any data being entered, but allow the user to enter data anywhere in Column K (including the used range portion). Can anyone please help me with how to do this? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Protecting a Used Range
Assume we can find the last used row using column A and the used range will
start in A1 Dim lastrow as Long lastrow = cells(rows.count,1).End(xlup).row cells.locked = False Range("A1").Resize(lastrow,21).Locked = True columns(11).Locked = false Activesheet.Protect Password:="secret" -- Regards, Tom Ogilvy "Paige" wrote: My code inserts multiple columns in various places, adds some vlookup and then selects the used range (which ends up to be Columns A-U, Rows A through 'varies each time'). I'm struggling with how to do the following: 1) Allow the user to enter any data they want outside of the used range (i.e., after the last row/column with an entry. 2) Protect Columns A:J and L:U (and their associated rows) in the used range from any data being entered, but allow the user to enter data anywhere in Column K (including the used range portion). Can anyone please help me with how to do this? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Protecting a Used Range
Thanks, Tom!!
"Tom Ogilvy" wrote: Assume we can find the last used row using column A and the used range will start in A1 Dim lastrow as Long lastrow = cells(rows.count,1).End(xlup).row cells.locked = False Range("A1").Resize(lastrow,21).Locked = True columns(11).Locked = false Activesheet.Protect Password:="secret" -- Regards, Tom Ogilvy "Paige" wrote: My code inserts multiple columns in various places, adds some vlookup and then selects the used range (which ends up to be Columns A-U, Rows A through 'varies each time'). I'm struggling with how to do the following: 1) Allow the user to enter any data they want outside of the used range (i.e., after the last row/column with an entry. 2) Protect Columns A:J and L:U (and their associated rows) in the used range from any data being entered, but allow the user to enter data anywhere in Column K (including the used range portion). Can anyone please help me with how to do this? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Protecting the Print Range. | Excel Discussion (Misc queries) | |||
Protecting a Range of Specific Cell/s | Excel Discussion (Misc queries) | |||
Protecting a Range of Specific Cell/s | Setting up and Configuration of Excel | |||
Protecting Range Names | Excel Discussion (Misc queries) | |||
Protecting Formulas from a range from being viewed | Excel Discussion (Misc queries) |