Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default short cut keys work- run macro does not

In Excel2000, I have the following macro that I use with a short cut
key:

Sub Copy_Values()
'
'
' Keyboard Shortcut: Ctrl+Shift+Z
'

Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
End Sub

I use this to Paste-Values after I have copied something. It works if I
use the assigned short cut keys (Ctrl+Shift+Z) but if I copy and then
try to run the macro using the Visual Basic toolbar, I get an error
message (PasteSpecial of Method of Range Class Failed). How come it
works with Short Cut keys but not with the Run icon?

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default short cut keys work- run macro does not

I suspect that running from the menu causes the clipboard to be cleared. At
least that has been my experience.

--
Regards,
Tom Ogilvy


"snax500" wrote in message
oups.com...
In Excel2000, I have the following macro that I use with a short cut
key:

Sub Copy_Values()
'
'
' Keyboard Shortcut: Ctrl+Shift+Z
'

Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
End Sub

I use this to Paste-Values after I have copied something. It works if I
use the assigned short cut keys (Ctrl+Shift+Z) but if I copy and then
try to run the macro using the Visual Basic toolbar, I get an error
message (PasteSpecial of Method of Range Class Failed). How come it
works with Short Cut keys but not with the Run icon?

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 692
Default short cut keys work- run macro does not

Here's a snippet that I use to paste formula, see if changing it to
paste value will work. Caution - it only works on the active sheet.

Dim rng

Set rng = Application.InputBox("Select Cell", Type:=8)

Selection.Copy
rng.Select
Selection.PasteSpecial Paste:=xlFormulas

--
steveB

Remove "AYN" from email to respond
"snax500" wrote in message
oups.com...
In Excel2000, I have the following macro that I use with a short cut
key:

Sub Copy_Values()
'
'
' Keyboard Shortcut: Ctrl+Shift+Z
'

Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
End Sub

I use this to Paste-Values after I have copied something. It works if I
use the assigned short cut keys (Ctrl+Shift+Z) but if I copy and then
try to run the macro using the Visual Basic toolbar, I get an error
message (PasteSpecial of Method of Range Class Failed). How come it
works with Short Cut keys but not with the Run icon?

Thanks



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
Short Cut keys Hardeep_kanwar[_2_] Excel Discussion (Misc queries) 2 January 12th 09 11:23 AM
Short Cut Keys Anne Excel Worksheet Functions 1 April 19th 07 05:10 PM
macro shortcut keys don't work andr01d Excel Discussion (Misc queries) 1 February 3rd 06 05:40 PM
Tracing and reassigning macro short cut keys Graeme Excel Programming 1 February 10th 05 06:07 PM
Macro shortcut keys not work properly Matan Excel Programming 1 April 20th 04 02:15 PM


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