Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Insert rows in the middle of the document???

Thanks Tom for your help....

It's getting closer....

The dates I'm working with don't match. The dates on sheet1 will fit into
the dates on sheet2.

sheet2 looks like this
col n col o
Jan2, 2006 april 16, 2006
April 16, 2006 May 3, 2006
May 3, 2006 dec 31, 2006


sheet1 looks like this
col a (start) col c
feb 14, 2006 feb 20, 2006

I have to make it look like this on sheet2
col n col o
Jan2, 2006 feb 14, 2006
feb 14, 2006 feb 20, 2006
feb 20, 2006 april 16, 2006
april 16, 2006 may 3, 2006
may 3, 2006 dec 31, 2006

any ideas???


"Tom Ogilvy" wrote:

Assuming each date on sheet2 is unique and is located in column A
Insert n rows:

Dim rng as Range, rng1 as Range
Dim rng2 as Range, n as Long
Dim res as Variant
n = 3
with worksheets("Sheet2")
set rng2 = .Range(.Cells(1,1),.Cells(1,1).End(xldown))
End With
set rng1 = Worksheets("Sheet1").Range("A1")
res = application.Match(rng1,rng2,0)
if not iserror(res) then
set rng = rng2(res)
rng.offset(1,0).Resize(n,1).EntireRow.Insert
end if

would be an approach.

--
Regards,
Tom Ogilvy


"srroduin" wrote in message
...
Given an initial date on worksheet 1 and
Given lots of data on worksheet 2 with dates start and finish

How do I insert a variable # of blank rows in worksheet 2 under where the
initial date falls in between?

start date < initial date < finish date

Thanks to Ron I've been able to select, copy and paste my stuff from
worksheet 1 to 2......but I've only been successful adding them at the

bottom
of the page. I need to be able to fit it between the right time periods.

Thanks in Advance!




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
how do i insert roman numberals in the middle of a sentence kay Excel Worksheet Functions 1 February 19th 09 10:02 PM
How can I freeze rows in the middle of a worksheet? (Line 14-15) Smiley[_2_] Excel Worksheet Functions 4 December 30th 08 10:19 PM
Insert Cell Contents in middle of web address Jetheat Excel Discussion (Misc queries) 2 March 5th 06 07:18 PM
Possible to insert cell data in the middle of line of text? Bob Smith Excel Worksheet Functions 6 July 29th 05 08:14 PM
How to insert carriage return in the middle of a text formula to . Dave Excel Discussion (Misc queries) 2 March 17th 05 02:14 PM


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