Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 30
Default Prevent paste from re-formatting cell

worksheet is protected and all cells except 4 are locked. Even though users
are not able to change formatting of these cells directly, I just realized
that pasting info into one of these cells changes the format (to that of the
copied info) and breaks the spreadsheet/calculator. Example: one of the
unlocked cells is a dropdown list (of months). If you incorrectly type a
value that is not on the list into the cell you will appropriately get a
customized error message and given the option to re-enter an allowed value.
However, If you paste that same incorrect value into the cell it will change
the formating of the cell, disable the dropdown box, and basically "break"
the spreadsheet. Can I prevent someone from accidently pasting info into one
of these cells. If not, how do I get the cell to keep original formatting ,
even if the pasted format is different. Thanks for you help.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Location: Bakersfield, CA
Posts: 45
Send a message via Skype™ to JBeaucaire[_85_]
Default Prevent paste from re-formatting cell

If it's that critical, then diable cut/copy/paste completely in this
workbook. This website gives you code and instructions on where to put it.
Once installed, no one will be able to do that, and will receive a message
onscreen if they try.

http://www.vbaexpress.com/kb/getarticle.php?kb_id=373
--
"Actually, I *am* a rocket scientist." -- JB

Your feedback is appreciated, click YES if this post helped you.


"BMac" wrote:
Can I prevent someone from accidently pasting info into one
of these cells. If not, how do I get the cell to keep original formatting ,
even if the pasted format is different. Thanks for you help.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default Prevent paste from re-formatting cell

Two caveats:

1) It requires macros to be enabled. If the workbook is opened with
macros off, there's no protection at all.

2) The routines won't work if the workbook is opened by a user with
MacXL. While one could substitute the default Mac keyboard shortcuts, in
MacXL, Copy alone has 7 different default keyboard shortcuts (CTRL-Ins,
Ctrl-c, Ctrl-Help, F3, CMD-Help, CMD-Ins, Cmd-c), and Paste has 4
(Shift-Del, Ctrl-v, CMD-v, F4).

In addition, in MacXL nearly any commands can be assigned to nearly
*any* shortcut key, including copy and paste.



In article ,
JBeaucaire wrote:

If it's that critical, then diable cut/copy/paste completely in this
workbook. This website gives you code and instructions on where to put it.
Once installed, no one will be able to do that, and will receive a message
onscreen if they try.

http://www.vbaexpress.com/kb/getarticle.php?kb_id=373

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Location: Bakersfield, CA
Posts: 45
Send a message via Skype™ to JBeaucaire[_85_]
Default Prevent paste from re-formatting cell

The page referenced:
http://www.vbaexpress.com/kb/getarticle.php?kb_id=373

....also includes a link to help you insure macros are enabled:
http://www.vbaexpress.com/kb/getarticle.php?kb_id=379

As for the Mac stuff and or any other commands oriented copy/paste method,
I'm sure they could be addressed as they are discovered by expanding the code
offered on that page to trap more events.

--
"Actually, I *am* a rocket scientist." -- JB

Your feedback is appreciated, click YES if this post helped you.


"JE McGimpsey" wrote:

Two caveats:

1) It requires macros to be enabled. If the workbook is opened with
macros off, there's no protection at all.

2) The routines won't work if the workbook is opened by a user with
MacXL. While one could substitute the default Mac keyboard shortcuts, in
MacXL, Copy alone has 7 different default keyboard shortcuts (CTRL-Ins,
Ctrl-c, Ctrl-Help, F3, CMD-Help, CMD-Ins, Cmd-c), and Paste has 4
(Shift-Del, Ctrl-v, CMD-v, F4).

In addition, in MacXL nearly any commands can be assigned to nearly
*any* shortcut key, including copy and paste.



In article ,
JBeaucaire wrote:

If it's that critical, then diable cut/copy/paste completely in this
workbook. This website gives you code and instructions on where to put it.
Once installed, no one will be able to do that, and will receive a message
onscreen if they try.

http://www.vbaexpress.com/kb/getarticle.php?kb_id=373


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default Prevent paste from re-formatting cell

My point was that, no, they *can't* be addressed for MacXL, since a user
can have entirely idiosyncratic keyboard shortcut assignments that can't
be programmatically discovered.

Just as a plain vanilla example, I know a number of MacXL users who map
Ctrl-p to Paste (leaving the Mac-default CMD-p assigned to Print). They
then are free to assign Ctrl-v to, say, (V)alidation, or CMD-v to Normal
(V)iew.

In addition, if they have mapped any of the default shortcuts to a
different function, there's no way of programmatically determining what
that mapping is, so by disabling, say F3 (default Copy), you may have
just permanently undone the user's customization.

Not saying it's a huge risk (which is why I used the relatively mild
word "caveat"), but it *is* a vulnerability.


In article ,
JBeaucaire wrote:

As for the Mac stuff and or any other commands oriented copy/paste method,
I'm sure they could be addressed as they are discovered by expanding the code
offered on that page to trap more events.

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
Can you prevent Copy-Paste from changing formatting without macros DCramlet Excel Discussion (Misc queries) 6 May 30th 14 07:18 AM
Prevent cut and paste over a range andy62 Excel Worksheet Functions 0 June 30th 07 04:22 AM
Prevent Formatting of a Cell when it is loaded Lizette Koehler Excel Discussion (Misc queries) 7 June 20th 07 12:38 AM
paste cell with formatting Lynn Excel Discussion (Misc queries) 2 November 1st 06 09:19 PM
How do I prevent certain Paste options soldier33w Excel Discussion (Misc queries) 1 February 8th 06 02:16 PM


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