Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Macro help. Insert row and copy formulas from row above

I have a worksheet that I need to insert rows but copy only the formulas from
the row above. Any suggestions?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Macro help. Insert row and copy formulas from row above

to copy the last row and maintain your formulas it is best to copy the last
row and insert the copy before the last row. Thne clear the non-formula
cells from the last row. A little backwards, but it will work.


Lastrow = range("A" & rows.Count).end(xlup).Row
Rows(Lastrow).copy
Rows(Lastrow).Insert
Rows(Lastrow + 1).SpecialCells(xlCellTypeConstants).ClearContents



"Kesbutler" wrote:

I have a worksheet that I need to insert rows but copy only the formulas from
the row above. Any suggestions?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Macro help. Insert row and copy formulas from row above

I have following formula working. But the new row is not protected. Is there
a way to have the macro lock the cells with the formula so they cannot be
updated by users?

Thanks

"Kesbutler" wrote:

I have a worksheet that I need to insert rows but copy only the formulas from
the row above. Any suggestions?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Macro help. Insert row and copy formulas from row above

Is there a way to have it copy only the formulas? Also, the workbook will be
password protected.

"Joel" wrote:

to copy the last row and maintain your formulas it is best to copy the last
row and insert the copy before the last row. Thne clear the non-formula
cells from the last row. A little backwards, but it will work.


Lastrow = range("A" & rows.Count).end(xlup).Row
Rows(Lastrow).copy
Rows(Lastrow).Insert
Rows(Lastrow + 1).SpecialCells(xlCellTypeConstants).ClearContents



"Kesbutler" wrote:

I have a worksheet that I need to insert rows but copy only the formulas from
the row above. Any suggestions?

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
Insert row and copy formulas Hugh Excel Discussion (Misc queries) 5 September 25th 09 05:28 PM
Insert row & copy formulas Paul Excel Programming 0 October 15th 08 02:51 PM
Macro to insert a row and copy down formulas from row above Sal Excel Discussion (Misc queries) 2 December 3rd 07 05:33 AM
Macro to insert copy and insert formulas only to next blank row bob Excel Programming 0 June 30th 06 12:02 PM
Insert Row and copy formulas Alan Excel Programming 4 February 22nd 04 06:26 PM


All times are GMT +1. The time now is 04:52 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"