ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   User-def shortcut to macro (https://www.excelbanter.com/excel-programming/293986-user-def-shortcut-macro.html)

bill

User-def shortcut to macro
 
Using macro recorder to assign Edit/Paste Special/Values
or /Formulas to a keyboard shortcut works fine, but can't
get it to work for Edit/Paste Special/All Except Borders.
It used to work fine in Excel 97, but not 2000. Anyone
know why? Thanks!


Bill Renaud[_2_]

User-def shortcut to macro
 
Sometimes in Excel, you now have to explicitly define and set a reference (I
guess to stymie new VBA programmers). (Grin!)

Try the following code (add any other parameters that you want explicitly
set to the PasteSpecial method, separated by commas):

Sub CopyAllExceptBorders()
Dim rng As Range

Set rng = ActiveCell

rng.PasteSpecial Paste:=xlPasteAllExceptBorders
End Sub

I used a button on the worksheet to call the macro, but it should work with
a keyboard shortcut. (I am using Excel 2000, SP-3.)
--
Regards,
Bill


"bill" wrote in message
...
Using macro recorder to assign Edit/Paste Special/Values
or /Formulas to a keyboard shortcut works fine, but can't
get it to work for Edit/Paste Special/All Except Borders.
It used to work fine in Excel 97, but not 2000. Anyone
know why? Thanks!





All times are GMT +1. The time now is 05:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com