Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Art Art is offline
external usenet poster
 
Posts: 587
Default Lock from moving cells

Hello:

Is there a way to lock from allowing to move cells? With VBA code?

(whenever someone moves a cell, it causes the formulas to go nuts and loses
its references and displays #REF, so I want to block from the user from
moving cells)

Please help.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Lock from moving cells

You can lock all the cells in the worksheet, protect the sheet and
specify that the user can select only unlocked cells (all via the
Protect Sheet dialog under Protection on the Tools menu).

That said, if merely changing the selection cause formulas to
misbehave, then I think you have more serious problems. Well written
formulas should be entirely agnostic about the selected cell. If you
are calling from worksheet cells functions written in VBA, note that
those functions should not reference "ActiveCell" or "Selection". If a
function needs to know whence it was called, it should use
Application.Caller or Application.ThisCell.

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email is on the web site)
USA Central Daylight Time (-5:00 GMT)


On Sun, 12 Oct 2008 08:00:01 -0700, art
wrote:

Hello:

Is there a way to lock from allowing to move cells? With VBA code?

(whenever someone moves a cell, it causes the formulas to go nuts and loses
its references and displays #REF, so I want to block from the user from
moving cells)

Please help.

Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.programming
Art Art is offline
external usenet poster
 
Posts: 587
Default Lock from moving cells

My problem was not changing the selection, only when one selects a cell and
drags and drops it somewhere else then the formulas go #REF.

I think the correct way to lock it is by using the CellDragAndDrop. Thanks
anyways.




"Chip Pearson" wrote:

You can lock all the cells in the worksheet, protect the sheet and
specify that the user can select only unlocked cells (all via the
Protect Sheet dialog under Protection on the Tools menu).

That said, if merely changing the selection cause formulas to
misbehave, then I think you have more serious problems. Well written
formulas should be entirely agnostic about the selected cell. If you
are calling from worksheet cells functions written in VBA, note that
those functions should not reference "ActiveCell" or "Selection". If a
function needs to know whence it was called, it should use
Application.Caller or Application.ThisCell.

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email is on the web site)
USA Central Daylight Time (-5:00 GMT)


On Sun, 12 Oct 2008 08:00:01 -0700, art
wrote:

Hello:

Is there a way to lock from allowing to move cells? With VBA code?

(whenever someone moves a cell, it causes the formulas to go nuts and loses
its references and displays #REF, so I want to block from the user from
moving cells)

Please help.

Thanks.


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
Moving text around cells without moving boarder lines Dale Excel Discussion (Misc queries) 1 December 15th 09 06:14 PM
how to lock pictures from moving or being deleted in excel 2007 Joel Excel Discussion (Misc queries) 1 April 18th 07 03:44 PM
Arrow Keys Moving Window Frame instead of Moving Between Cells nemmex Excel Discussion (Misc queries) 2 April 9th 07 09:08 AM
How do I lock the top 2 rows (headings) so that they are always displayed when moving around the spreadsheet? Clubsprint Excel Discussion (Misc queries) 1 May 5th 06 01:38 AM
Cells(col,row) keep moving to lower case and I can not ref. a cells in a differnet sheet WayneL[_2_] Excel Programming 2 April 25th 05 11:27 PM


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