How do I set up a key to insert rows in excel?

  • Thread starter Thread starter cravingmad
  • Start date Start date
C

cravingmad

Ages ago I set up a function (ctrl + 2 I think) so I could easily add a row
into an excel sheet without right clicking loads of times - unfortunatly I
need to do it again on another pc and can't remember how to do it - can
anyone help please - thank you.
Helen.
 
Hi,

Alt+F11 to open VB editor. Right click 'This Workbook' and insert module and
paste this in on the right

Sub insert()
Selection.EntireRow.insert
End Sub

Back on the worksheet:
Tools|Macro|Macros
From the dropdown select 'This Workbook' and highlight the macro name
Click 'Options'
Enter a letter to call your macro

Back on the worksheet CTRL+(Letter) will insert an entirerow.

Mike
 
Do you mean:

Sub InsetIt()
ActiveCell.EntireColumn.Insert
End Sub

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk
 
Hi, I'm sorry I was alright with the opening of the VB editor, then right
clicked 'this workbook' - do i then typr in sub insert etc.. in the blank box
that opened - sorry if I seem thick, but i'm sure i didn't do this last time.
Thanks again.
Helen
 
Hi,

In the empty box on the right simply paste the 3 lines of code I gave you
which include the Sub & end sub bit

I forgot to mention on my past post you can pick a number to run your macro
as well as a lettter.

Mike
 

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