Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 553
Default RESTRICT TO PASTE VALUES ONLY

What would be the appropriate code to restrict the user from using pasting
format. In other words, whenever a user uses Ctrl+V only the values are
pasted.

Thanx in advance.

--

Best Regards,
FARAZ A. QURESHI
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 396
Default RESTRICT TO PASTE VALUES ONLY

Use Application.OnKey to assign one of your macro's to the shortcut
combination Ctrl-V.

Remember to set it back afterwards, or even if the user deactivates the
workbook (since this can be annoying).

--
Wigi
http://www.wimgielis.be = Excel/VBA, soccer and music


"FARAZ QURESHI" wrote:

What would be the appropriate code to restrict the user from using pasting
format. In other words, whenever a user uses Ctrl+V only the values are
pasted.

Thanx in advance.

--

Best Regards,
FARAZ A. QURESHI

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default RESTRICT TO PASTE VALUES ONLY

Is there one for copy/paste?

"Gord Dibben" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
'retain formatting when a cell is copied over
Dim myValue
With Application
.EnableEvents = False
myValue = Target.Value
.Undo
Target = myValue
.EnableEvents = True
.CutCopyMode = False
End With
End Sub

Note: works only with with copy/paste, not cut/paste


Gord Dibben MS Excel MVP


On Sun, 20 Jul 2008 23:38:00 -0700, FARAZ QURESHI
wrote:

What would be the appropriate code to restrict the user from using pasting
format. In other words, whenever a user uses Ctrl+V only the values are
pasted.

Thanx in advance.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default RESTRICT TO PASTE VALUES ONLY

I think you mean cut/paste.

No. I don't have code for that.


Gord

On Sun, 7 Sep 2008 20:33:01 -0700, aggiemullins
wrote:

Is there one for copy/paste?

"Gord Dibben" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
'retain formatting when a cell is copied over
Dim myValue
With Application
.EnableEvents = False
myValue = Target.Value
.Undo
Target = myValue
.EnableEvents = True
.CutCopyMode = False
End With
End Sub

Note: works only with with copy/paste, not cut/paste


Gord Dibben MS Excel MVP


On Sun, 20 Jul 2008 23:38:00 -0700, FARAZ QURESHI
wrote:

What would be the appropriate code to restrict the user from using pasting
format. In other words, whenever a user uses Ctrl+V only the values are
pasted.

Thanx in advance.




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
Restrict users from changing to certain values in a cell Dolphinv4 Excel Discussion (Misc queries) 0 May 13th 08 11:26 AM
find values in multiple cells and paste row values izzyt1972 Excel Discussion (Misc queries) 5 December 26th 07 10:14 PM
can you change the default paste method? (paste values) David A Brown Excel Discussion (Misc queries) 3 December 18th 07 09:59 AM
RESTRICT PASTE Gator Girl Excel Worksheet Functions 0 August 29th 07 07:46 PM
How do I restrict data movement (cut & paste) to only one column? Kev Nurse Excel Discussion (Misc queries) 8 February 15th 05 02:41 AM


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