View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
EricG EricG is offline
external usenet poster
 
Posts: 220
Default C'mon. Isn't there a SIMPLE way to...

Oops - left out the second "&" after the ":" in the formulas. I corrected
below.

"EricG" wrote:

Something like this?

ActiveSheet.Rows(rgWTBaEnd & ":" & rgWTBaEnd + intAInsert-1).Select
Selection.Insert Shift:=xlDown

This will insert the new rows ABOVE row rgWTBaEnd. If you want to insert
the new rows beneath that row, use:

ActiveSheet.Rows(rgWTBaEnd + 1 & ":" & rgWTBaEnd + intAInsert).Select
Selection.Insert Shift:=xlDown

HTH,

Eric

"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