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: 184
Default Insert a Range

Hello. I am trying to write code that will do an xlendup on a
worksheet to find the last row, and then offset 9 rows up. After I
have the range, copy the range and insert on the next available line.
I tried some code (below) but couldnt get it to work. Any ideas?
Thanks!

lastrow = ActiveSheet.Cells(Cells.Rows.Count, "D").End(xlUp).Row
lastrange = ActiveSheet.Rows(lastrow.Resize(9, 0))

Rows(lastrange).Copy.
Rows(lastrange).Insert Shift:=xlDown

 
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 value based on range GL Excel Worksheet Functions 3 October 29th 08 09:04 PM
How to insert from name range into a paragraph? misterno Excel Worksheet Functions 2 March 9th 07 03:52 PM
Auto insert a range fastballfreddy Excel Discussion (Misc queries) 1 May 9th 06 12:41 AM
Insert...Name Range childofthe1980s Excel Discussion (Misc queries) 1 May 24th 05 03:52 PM
Insert a Range name Pete Excel Programming 1 January 14th 04 04:59 PM


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