User-def shortcut to macro

  • Thread starter Thread starter bill
  • Start date Start date
B

bill

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!
 
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.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top