Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to Insert Current Date into cell - Macro to "Save As" | Excel Worksheet Functions | |||
Recorded single column insert in macro. Macro inserts two not one | Excel Programming | |||
make a macro to insert a macro | Excel Discussion (Misc queries) | |||
Macro to insert copy and insert formulas only to next blank row | Excel Programming | |||
DO NOT Insert Row - Macro | Excel Worksheet Functions |