[program-l] Re: Microsoft Excel 2003: running a macro on row insertion

  • From: "George Bell" <george@xxxxxxxxxxxxxxxxxxx>
  • To: <program-l@xxxxxxxxxxxxx>
  • Date: Mon, 12 Sep 2005 18:04:29 +0100

Hi Pranav,

If I know what the Macro Command was for up arrow, I'd say
yes.  However, I can't seem to get away from a specific
co-ordinate.

What I wanted to do, was search for a string, then insert a
row above.  This would then be assigned to a button which,
when clicked on, would insert a row above it.

Sub Insert_Row()
'
' Insert_Row Macro
' Macro recorded 12/09/2005 by George Bell
'
' Keyboard Shortcut: Ctrl+i
'
    Rows("4:4").Select
    Selection.Insert Shift:=xlUp
End Sub

George.

> -----Original Message-----
> From: program-l-bounce@xxxxxxxxxxxxx 
> [mailto:program-l-bounce@xxxxxxxxxxxxx] On Behalf Of
Pranav Lal
> Sent: 12 September 2005 16:33
> To: program-l-freelists.org
> Subject: [program-l] Microsoft Excel 2003: running a macro
on 
> row insertion
> 
> Hi all,
> 
> Is it possible to run a macro when a user inserts a row in
a 
> worksheet? I took a look at the list of events and was
unable 
> to find any suitable event.
> 
> I need this capability in my time sheet Excel sheet. Some 
> users work on multiple projects in a day so need to add 
> additional rows. The problem is that there are certain
hidden 
> columns like activity code, project code etc. They need to

> copy a formula from the previous row into the newly
inserted 
> row. They forget to do this.
> 
> Pranav
>
------------------------------------------------------------
--
>
------------------------------------------------------------
--
> -----------
> Pranav
> 
> ** To leave the list, click on the immediately-following
link:-
> **
[mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
> ** If this link doesn't work then send a message to:
> ** program-l-request@xxxxxxxxxxxxx
> ** and in the Subject line type
> ** unsubscribe
> ** For other list commands such as vacation mode, click on
the
> ** immediately-following link:-
> ** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
> ** or send a message, to
> ** program-l-request@xxxxxxxxxxxxx with the Subject:- faq
> 
** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq

Other related posts: