PC Review


Reply
Thread Tools Rate Thread

Change paste to only paste values

 
 
Chris Trygstad
Guest
Posts: n/a
 
      6th Nov 2008
I have a spreadsheet that is nice and formatted just the way I want it
to be, but the people using the spreadsheet are mainly copying and
pasting data from another spreadsheet into the target spreadsheet, and
they rarely remember to "paste special" ---> "values" to preserve the
formatting. I've tried to protect the formatting via protect
worksheet, but that seems to get overridden if the values are pasted
in.

So now, I'm trying to devise a way to use VB to make all paste
operations default to paste only values. I saw this code,
Sub New_paste() ActiveCell.PasteSpecial XlValues End Sub, on the web,
but it doesn't do anything, and I don't know much about VB, but I do
know how to get into the VB editor. Is there an easy way to make all
paste operations (shortcut on toolbar, right-click menu, edit menu,
ctrl+v) default to paste values only?
 
Reply With Quote
 
 
 
 
Chris Trygstad
Guest
Posts: n/a
 
      6th Nov 2008
It actually looks like this does the trick:

Private Sub Workbook_SheetChange(ByVal Sh As Object, _
ByVal Target As Range)
Dim myValue
With Application
..EnableEvents = False
myValue = Target.Value
..Undo
Target = myValue
..EnableEvents = True
End With
End Sub

If anyone has a better suggestion, let me know. The only downfall i
see is the inability to "Undo" after the Paste operation is complete.

Chris

On Nov 6, 1:39*pm, Chris Trygstad <christrygs...@gmail.com> wrote:
> I have a spreadsheet that is nice and formatted just the way I want it
> to be, but the people using the spreadsheet are mainly copying and
> pasting data from another spreadsheet into the target spreadsheet, and
> they rarely remember to "paste special" ---> "values" to preserve the
> formatting. I've tried to protect the formatting via protect
> worksheet, but that seems to get overridden if the values are pasted
> in.
>
> So now, I'm trying to devise a way to use VB to make all paste
> operations default to paste only values. I saw this code,
> Sub New_paste() ActiveCell.PasteSpecial XlValues End Sub, on the web,
> but it doesn't do anything, and I don't know much about VB, but I do
> know how to get into the VB editor. Is there an easy way to make all
> paste operations (shortcut on toolbar, right-click menu, edit menu,
> ctrl+v) default to paste values only?


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
EXCEL PASTE DOES NOT CHANGE DATA - PASTE DOESN'T WORK! robin l Microsoft Excel Worksheet Functions 4 16th Apr 2009 06:52 PM
can you change the default paste method? (paste values) David A Brown Microsoft Excel Misc 3 18th Dec 2007 09:59 AM
Automating copy/paste/paste special when row references change Carl LaFong Microsoft Excel Programming 4 8th Oct 2007 06:10 AM
to find change and paste existing values/rows in excel with help of form Claudia Microsoft Excel Misc 1 10th Aug 2006 03:03 PM
PASTE SPECIAL - Paste Values vs Paste Unicode xterri Microsoft Excel Misc 1 30th Jun 2004 01:53 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:42 AM.