View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Insert Function Problem

Hi Chris,

In the absence of any stipulation by you, Excel makes a guess as to which
way to shift your data. How Excel makes that guess depends on the
configuration of your data. As with most Excel guesses, they are sometimes
right and frequently wrong. The answer, in this case, is to be explicit.

You can provide this information by using the optional shift argument to the
insert method, e.g.:

Range("B26:G26").Resize(Range("b25").Value).Insert shift:=xlDown


---
Regards,
Norman



"zero635" wrote in
message ...

Ok, I am using the following code to insert rows below a header.

Sub InsertRange()

Range("B26:G26").Resize(Range("b25").Value).Insert

End Sub

Well, with a value of 8 or greater in cell "B25", my data below it
shifts to the right.

With a value of 7 or less it shifts the data below down and gives me
the empty spaces I need.

Can anyone tell me why a value of 8 or greater would cause this formula
to shift my data to the right, instead of down like a normal insertion?

Thank You,
Chris


--
zero635
------------------------------------------------------------------------
zero635's Profile:
http://www.excelforum.com/member.php...o&userid=24802
View this thread: http://www.excelforum.com/showthread...hreadid=388048