LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro for Inserting Rows

Hi, I have never posted before but hope that someone can help me with a
problem now that I have.

I am developing a spreadsheet in which I want to give users the power to
insert additional rows, which sounds easy enough. However what I want is to
do is have a macro they can use to do this, as for every row that is inserted
I need the formulas present in the existing rows to be copied into newly
inserted row. I don't think the users will have the awareness to copy the
formulas into the new rows themselves, hence I want to make it happen
automatically.

I found some VB script in another posting that has almost solved this for me
(below), but the problem is that running this inserts a row in the same row
position each time (row 18). What I want is for the user to either highlight
the row of their choosing or click into a cell in that row and for the macro
to insert a row in the position they have selected.

Can anyone suggest what I am doing wrong, please? I am a novice with VB
script so don't know where to start.

Rows("18:18").Select
Selection.Insert Shift:=xlDown
Range("H15").Select
INSERTPT = ActiveCell.Value
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Range("H18").Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
 
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
Inserting rows via macro clane[_6_] Excel Programming 0 November 3rd 04 09:08 PM
Inserting Rows Macro -- please help!! tratliff[_10_] Excel Programming 4 August 24th 04 03:03 PM
Inserting rows macro Jonsson Excel Programming 2 January 8th 04 02:03 PM
Inserting Rows Through a Macro Mike[_56_] Excel Programming 3 October 8th 03 03:52 AM
INSERTING ROWS WITH A MACRO Jay Dean Excel Programming 15 September 16th 03 05:08 PM


All times are GMT +1. The time now is 06:35 AM.

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

About Us

"It's about Microsoft Excel"