Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 21
Default Copying row & inserting

I'm using the macro below to insert a number of rows specified by a user. I
need to have it copy the row above the selected cell and insert the number of
rows specified and then delete the data in columns A,B,J,L in the rows
inserted.

Sub InsertRows()
Dim Rng
Rng = InputBox("Enter number of rows required.")
Range(ActiveCell.Offset(0, 0), ActiveCell.Offset(Rng - 1, 0)).Select
Selection.EntireRow.Insert
End Sub

Thanks,
Chance

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 903
Default Copying row & inserting

see
Insert a Row using a Macro to maintain formula
http://www.mvps.org/dmcritchie/excel/insrtrow.htm
--
HTH,
David McRitchie, Microsoft MVP - Excel
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Chance224" wrote in message ...
I'm using the macro below to insert a number of rows specified by a user. I
need to have it copy the row above the selected cell and insert the number of
rows specified and then delete the data in columns A,B,J,L in the rows
inserted.

Sub InsertRows()
Dim Rng
Rng = InputBox("Enter number of rows required.")
Range(ActiveCell.Offset(0, 0), ActiveCell.Offset(Rng - 1, 0)).Select
Selection.EntireRow.Insert
End Sub

Thanks,
Chance



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
Inserting Lines or Copying lines with formulas but without data wnfisba Excel Discussion (Misc queries) 2 August 18th 06 04:41 PM
Prevent Copying Data Chrisp Excel Discussion (Misc queries) 2 March 27th 06 12:06 AM
Automatically copying fomulae when Inserting rows Ian Goodhardt Excel Discussion (Misc queries) 3 August 17th 05 07:01 PM
Problems copying street addresses and dates C. Dales Excel Discussion (Misc queries) 4 February 11th 05 01:43 PM
copying cells from other worksheets yesbob Excel Discussion (Misc queries) 1 February 7th 05 05:18 PM


All times are GMT +1. The time now is 07:33 AM.

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"