Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default MACRO - INSERT ROW

Hi All,
I would like to create a macro with a box that allows the user to insert a
row by pressing the button. I have done this once before but many years ago
and I had a training book! Can someone help me? I know it is fairly simple
but I rarely use macros and I am not sure how to write the code.
Thanks
Chantelle
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default MACRO - INSERT ROW

On Sep 24, 9:28*pm, Chantelle
wrote:
Hi All,
I would like to create a macro with a box that allows the user to insert a
row by pressing the button. *I have done this once before but many years ago
and I had a training book! Can someone help me? I know it is fairly simple
but I rarely use macros and I am not sure how to write the code.
Thanks
Chantelle


Hi Chantelle,

This should do it for you. Attach it to a button or set it to a hotkey
under the macro options.

Steven

Sub InsRw()
Dim Rng as Range

Set Rng = ActiveCell.EntireRow

Rng.Insert Shift:=xlDown
Set Rng = Rng.Offset(1,0)
Rng.Select

End Sub
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 257
Default MACRO - INSERT ROW

As a general rule of thumb, Chantelle, try this: Start recording a macro.
(Don't worry about the name and the comments, just rush on by that because
you won't be using them afterward.) Do the task you're trying to program.
Then stop recording the macro and go look at what was recorded in the macro.
You can almost always use what you see there, usually with some modification
but nothing very complicated.

Anything you don't understand in the macro, post a question here and ask
about THAT. You'll probably end up understanding more that way, and able to
do more for yourself and more quickly as a result.

--- "Chantelle" wrote:
I would like to create a macro with a box that allows the user to insert a
row by pressing the button. I have done this once before but many years ago
and I had a training book! Can someone help me? I know it is fairly simple
but I rarely use macros and I am not sure how to write the code.

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
Macro to Insert Current Date into cell - Macro to "Save As" Guy[_2_] Excel Worksheet Functions 4 December 12th 08 08:20 PM
Recorded single column insert in macro. Macro inserts two not one lostatlewisu Excel Programming 3 August 16th 07 01:26 AM
make a macro to insert a macro mithu Excel Discussion (Misc queries) 6 March 20th 07 06:04 PM
Macro to insert copy and insert formulas only to next blank row bob Excel Programming 0 June 30th 06 12:02 PM
DO NOT Insert Row - Macro Danny Excel Worksheet Functions 4 May 5th 06 01:04 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"