Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
ben ben is offline
external usenet poster
 
Posts: 2
Default Macro to only allow pasting of values and not format??

Yes Celt,

Even if I'm using excel for years I sometime learn so basic things !...

I've done what you said but also renamed "MyCtrlV" in "MyPaste" and
changed the macro :

Sub MyPaste()
' Will act like Copy paste Value
If Application.CutCopyMode Then
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
End If
End Sub

For "ThisWorkbook" it is now including the following code :

Private Sub Workbook_Open()
Application.OnKey "^v", "MyPaste"
Application.OnKey "{RETURN}", "MyPaste"
End Sub

Private Sub Workbook_Activate()
Application.OnKey "^v", "MyPaste"
Application.OnKey "{RETURN}", "MyPaste"
End Sub

Private Sub Workbook_Deactivate()
Application.OnKey "^v"
Application.OnKey "{RETURN}"
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.OnKey "^v"
Application.OnKey "{RETURN}"
End Sub

For the menus I don't know when I'll have some time to work on it. If
someone already have the solution on hand...

Benoit

*** Sent via Developersdex http://www.developersdex.com ***
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
Pasting Values between sheets in VBA Matt Excel Worksheet Functions 1 September 27th 06 05:41 PM
pasting values ceemo Excel Discussion (Misc queries) 0 November 23rd 05 12:39 PM
Pasting Format and values LB79 Excel Discussion (Misc queries) 5 August 25th 05 02:18 PM
pasting values Steiner Excel Discussion (Misc queries) 1 August 11th 05 02:50 PM
Pasting numbers and formulas without pasting format. Dan Excel Discussion (Misc queries) 3 March 27th 05 03:47 AM


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