Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default updating formulas at inserted rows with locked columns

I suspect that this is not such an unusual occurrence, and that there is a
work-around, but maybe not...

I have a worksheet in which it makes absolute sense (esp. knowing the end
users) to lock some of the columns.
The problem occurs when the user inserts a new row, which they will need to
do, and formulas from the rows above (this is within the field of data) need
to be copied into the new row. It's not possible -the cell / column is
locked.

Hopefully, I do not need to add a command button that assesses the cursor
position (selected row?), unlocks the worksheet, inserts the row, copies the
formula, then re-locks the row; however, this is what I am thinking will
need to be done.

as always, thanks in advance,
mark


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default updating formulas at inserted rows with locked columns

Hi Mark

As you do not want to enable the user to unprotect the sheet, it can only be
done as you described.

See if this will get you started:

Sub InsertLine()
ActiveSheet.Unprotect Password:="JustMe"
TargetRow = ActiveCell.Row
Rows(TargetRow).Offset(1, 0).Insert shift:=xlDown
Range("D" & TargetRow).Copy Range("D" & TargetRow + 1)
ActiveSheet.Protect Password:="JustMe"
End Sub

Regards,

Per

"Mark Kubicki" skrev i meddelelsen
...
I suspect that this is not such an unusual occurrence, and that there is a
work-around, but maybe not...

I have a worksheet in which it makes absolute sense (esp. knowing the end
users) to lock some of the columns.
The problem occurs when the user inserts a new row, which they will need
to do, and formulas from the rows above (this is within the field of data)
need to be copied into the new row. It's not possible -the cell / column
is locked.

Hopefully, I do not need to add a command button that assesses the cursor
position (selected row?), unlocks the worksheet, inserts the row, copies
the formula, then re-locks the row; however, this is what I am thinking
will need to be done.

as always, thanks in advance,
mark


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
Updating For RowCount to accommodate inserted rows Bishop Excel Programming 1 April 21st 09 10:02 PM
Update References in Formulas when Columns are Inserted and Rows are Skipped Arnold[_3_] Excel Programming 4 February 3rd 07 05:00 PM
Automatically copy formulas/functions to inserted rows. Barbara Excel Worksheet Functions 7 February 2nd 07 11:40 PM
Can array formulas work if rows are inserted? Chris Excel Worksheet Functions 1 March 16th 06 03:30 PM
How to have formulas and formats auto copy to new inserted rows DippyDawg Excel Discussion (Misc queries) 2 August 5th 05 03:09 PM


All times are GMT +1. The time now is 02:53 AM.

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

About Us

"It's about Microsoft Excel"