Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Change paste to only paste values

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Change paste to only paste values

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 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
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
EXCEL PASTE DOES NOT CHANGE DATA - PASTE DOESN'T WORK! robin l Excel Worksheet Functions 7 April 16th 09 07:56 PM
can you change the default paste method? (paste values) David A Brown Excel Discussion (Misc queries) 3 December 18th 07 09:59 AM
Automating copy/paste/paste special when row references change Carl LaFong Excel Programming 4 October 8th 07 06:10 AM
to find change and paste existing values/rows in excel with help of form Claudia Excel Discussion (Misc queries) 1 August 10th 06 03:03 PM
Dynamic Copy/Paste Special Formulas/Paste Special Values Sharon Perez Excel Programming 3 August 7th 04 09:49 PM


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