Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I create a custom shortcut like Ctrl+D to do certain task in excel 2010 using VBA? Also I'd like to use this shortcut again and again for different files.

However, I used VBA before for very simple repetitive tasks such as copying certain range of cells and inserting them into among cells in another sheet, and repeating this procedure for next 10 cells, or creating graphs using certain range of cells and repeating that procedure for next range of cells etc.

share|improve this question

It is called a macro. When you create a macro, you can assign it a key binding. Make sure to save it someone other than the file that you are using if you want to use it in other files easily (otherwise you will have to navigate to the file that has the macro that you are looking for).

share|improve this answer

Once you've created a macro (via recording it or creating it in the VBA editor), you can assign it a shortcut key as soandros has mentioned.

This is in Excel 2007, but I'm sure the layout is still similar:

enter image description here

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .