View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default C'mon. Isn't there a SIMPLE way to...

Robin,

In that case the syntax is

intAInsert = 5
Range("rgWTBaEnd").Resize(intAInsert).EntireRow.In sert

Mike

"Robin" wrote:

Mike H,

rgWTBaEnd is a range name. I use range names so if the layout of a
worksheet changes I don't have to change any cell addresses hard keyed into
programming lines. Sorry for the confusion.

I tried you suggestion and and inserted "rgrgWTBaEnd" (in quotes) where you
had the 7. I got a Run TIme Error 13 - Type Mismatch.

I'll try one of the other suggestions but play around with yours. It DOES
seem it should work...from my limited experience!

Thank you,
Robin

"Mike H" wrote:

Robin,

I have no idea what you mean by

The cell I want to go to is rgWTBaEnd


Perhaps you could explain a bit more but to insert n rows use this

intAInsert = 5
Rows(7).Resize(intAInsert).Insert

This inserts 5 rows a row 7

Mike


"Robin" wrote:

I'm pretty good with Access VBA but new to Excel.
Isn't there a simple way to go to a cell and insert x number of rows based
on an integer variable.

The cell I want to go to is rgWTBaEnd and the number of rows I wnat to
insert is intAInsert.

I can't believe one must do what I'm seeing in this discussion group for
something that simple. Help me please.

Thanks,
Robin