LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Macro: Insert Blank Row with formulas uses absolute position probl

hi,

How about this

LastRow = ActiveSheet.UsedRange.Rows.Count
Rows(LastRow).Copy
Rows(LastRow).Offset(1).PasteSpecial Paste:=xlPasteAll

Mike

"steveb" wrote:

My problem:
Creating a macro to insert a new blank row, then fill that row with the
formulas/formatting from the row above. (ie I'm trying to keep my file size
at the smallest it needs to be for the data in it)

Simple, yes. But having recorded the Macro Excel (vb) always inserts the row
at the same row number (ie always inserts the new row at row 18), whereas I
need the macro to create a row beneath the last row with data in it which
could be row 60 or 70 etc.

I think I need the macro to refer to a relative row position rather than an
absolute row position. Can I do that?

 
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, position, and resize a picture w/ Macro John Excel Discussion (Misc queries) 1 July 10th 07 07:21 PM
macro to insert blank line when lines sum to zero TCoats Excel Discussion (Misc queries) 0 July 2nd 07 05:08 PM
Insert blank line macro laidebug Excel Worksheet Functions 1 April 14th 06 11:56 PM
Macro To Insert Blank Row? rtidrtid Excel Discussion (Misc queries) 1 February 3rd 06 03:00 PM
Macro to insert blank lines Terry Pinnell Excel Discussion (Misc queries) 6 October 21st 05 11:21 PM


All times are GMT +1. The time now is 12:47 PM.

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"