Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default VBA for worksheet change (add row) event (I think)

2003/2007


When I applied worksheet protection, I "permitted" the User to add rows to the sheet.

What VBA can I use to remove protection from all cells in the newly added row
so that the user may fill the cells with data, without permitting the User to change
data in all the previously existing cells?

I see two issues:
(1) How do I "select" just the newly added cells within the UsedRange of the protected sheet?
(2) Formatting those cells is not my concern as I know how to do that.

TIA EagleOne
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default VBA for worksheet change (add row) event (I think)

Partial success.

How can I limit the change event below to just add row change events?

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim myRange As Range
ActiveSheet.Unprotect Password:="xxxx"
Set myRange = Intersect(ActiveSheet.UsedRange, Selection)
Selection.Locked = False
Selection.FormulaHidden = False
ActiveSheet.Protect Password:="xxxx", DrawingObjects:=False, Contents:=True, _
Scenarios:=False, AllowFormattingCells:=True, AllowFormattingRows:=True, _
AllowInsertingRows:=True, AllowSorting:=True, AllowFiltering:=True, _
AllowUsingPivotTables:=True
End Sub


wrote:

2003/2007


When I applied worksheet protection, I "permitted" the User to add rows to the sheet.

What VBA can I use to remove protection from all cells in the newly added row
so that the user may fill the cells with data, without permitting the User to change
data in all the previously existing cells?

I see two issues:
(1) How do I "select" just the newly added cells within the UsedRange of the protected sheet?
(2) Formatting those cells is not my concern as I know how to do that.

TIA EagleOne

Reply
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
Cell value change to trigger macro (worksheet change event?) Neil Goldwasser Excel Programming 4 January 10th 06 01:55 PM
Worksheet change event I think? Big H Excel Programming 1 November 18th 05 08:24 PM
Change Cell from Validated List Not Firing Worksheet Change Event [email protected] Excel Programming 3 October 4th 04 03:00 AM
worksheet change event gautamvt Excel Programming 1 December 10th 03 05:15 PM


All times are GMT +1. The time now is 10:13 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"