PC Review


Reply
Thread Tools Rate Thread

Change paste to paste special

 
 
Howard
Guest
Posts: n/a
 
      3rd Nov 2009
I tried this before, but I can't get things to work the way I want. PROBABLY
because I didn't explain things correctly.

I want to declare a range of cells (K18:K37), on sheet 1, the active spread
sheet, so that when a user clicks on one of these cells, and clicks paste, it
will actually paste special as a value. (The same as if the user clicked
"paste special" and then "value".

Thanks for any help you can give.
--
Howard
 
Reply With Quote
 
 
 
 
Luke M
Guest
Posts: n/a
 
      3rd Nov 2009
'Right click on sheet tab, view code, paste this in:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("K18:K37")) Is Nothing Then Exit Sub
Application.EnableEvents = False
On Error Resume Next

'Check to see if a paste action is occuring
If Application.CutCopyMode = xlCopy Or _
Application.CutCopyMode = xlCut Then

Application.Undo
Selection.PasteSpecial Paste:=xlPasteValues
End If

Application.EnableEvents = True

End Sub
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Howard" wrote:

> I tried this before, but I can't get things to work the way I want. PROBABLY
> because I didn't explain things correctly.
>
> I want to declare a range of cells (K18:K37), on sheet 1, the active spread
> sheet, so that when a user clicks on one of these cells, and clicks paste, it
> will actually paste special as a value. (The same as if the user clicked
> "paste special" and then "value".
>
> Thanks for any help you can give.
> --
> Howard

 
Reply With Quote
 
Mike H
Guest
Posts: n/a
 
      3rd Nov 2009
Howard,

Maaybe this

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
On Error Resume Next
If Not Intersect(Target, Range("K18:K37")) Is Nothing Then
Application.EnableEvents = False
For Each c In Target
If c.HasFormula Then
Target.Value = UCase(Target.Value)
End If
Next
Application.EnableEvents = True
End If
End Sub


Mike

"Howard" wrote:

> I tried this before, but I can't get things to work the way I want. PROBABLY
> because I didn't explain things correctly.
>
> I want to declare a range of cells (K18:K37), on sheet 1, the active spread
> sheet, so that when a user clicks on one of these cells, and clicks paste, it
> will actually paste special as a value. (The same as if the user clicked
> "paste special" and then "value".
>
> Thanks for any help you can give.
> --
> Howard

 
Reply With Quote
 
Howard
Guest
Posts: n/a
 
      3rd Nov 2009
Thanks Luke:
I'll try this, but it looks like what I'm looking for.
Thanks again.
--
Howard


"Luke M" wrote:

> 'Right click on sheet tab, view code, paste this in:
>
> Private Sub Worksheet_Change(ByVal Target As Range)
> If Intersect(Target, Range("K18:K37")) Is Nothing Then Exit Sub
> Application.EnableEvents = False
> On Error Resume Next
>
> 'Check to see if a paste action is occuring
> If Application.CutCopyMode = xlCopy Or _
> Application.CutCopyMode = xlCut Then
>
> Application.Undo
> Selection.PasteSpecial Paste:=xlPasteValues
> End If
>
> Application.EnableEvents = True
>
> End Sub
> --
> Best Regards,
>
> Luke M
> *Remember to click "yes" if this post helped you!*
>
>
> "Howard" wrote:
>
> > I tried this before, but I can't get things to work the way I want. PROBABLY
> > because I didn't explain things correctly.
> >
> > I want to declare a range of cells (K18:K37), on sheet 1, the active spread
> > sheet, so that when a user clicks on one of these cells, and clicks paste, it
> > will actually paste special as a value. (The same as if the user clicked
> > "paste special" and then "value".
> >
> > Thanks for any help you can give.
> > --
> > Howard

 
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
Outlook 2007 Macro: Paste - Paste Special - Unformatted Text Gary Petersen Microsoft Outlook VBA Programming 9 28th Dec 2009 03:37 PM
Automating copy/paste/paste special when row references change Carl LaFong Microsoft Excel Programming 4 8th Oct 2007 06:10 AM
Dynamic Copy/Paste Special Formulas/Paste Special Values Sharon Perez Microsoft Excel Programming 3 7th Aug 2004 09:49 PM
PASTE SPECIAL - Paste Values vs Paste Unicode xterri Microsoft Excel Misc 1 30th Jun 2004 01:53 AM
Copied formulas paste as text and paste special does not work JJ Microsoft Excel Worksheet Functions 0 14th Sep 2003 08:41 PM


Features
 

Advertising
 

Newsgroups
 


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