LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default C'mon. Isn't there a SIMPLE way to...

Robin,

Sorry - I assumed rgWTBaEnd was a row number. I'm glad you were able to get
the solution you needed from one of the other folks.

Cheers,

Eric

"Robin" wrote:

EricG,

After trying Mike H's below I trie yours and got the same Run Time Error 13.
The rgWTBaEnd is a range name which refers to a single cell. Yours, as
MikeH's seems like it should work. Coming from Access VBA, it's these
references in Excel that are really confusing. Is the & ":" & in your line
trying to create a range from cells as you would do if you were keying in a
range in a formula? I tried removing that and the second reference to my
range so it would only refer to the single cell range. Putting the range
name in quotes gives me the Error 13 above. If I remove the quotes I get Run
Time error 1004 - Application Defined or Object...

Sorry I'm not getting what is probably simple. Or is it my reference to a
range name that is throwing everything off? I just assumed I could use range
names in VBA.

Thank you,
Robin

"EricG" wrote:

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



 
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
IF formula-simple question; simple operator Rich D Excel Discussion (Misc queries) 4 December 6th 07 03:36 PM
Simple problem, simple formula, no FUNCTION ! Ron@Buy Excel Worksheet Functions 6 September 28th 07 04:51 PM
Simple Simple Excel usage question BookerW Excel Discussion (Misc queries) 1 June 23rd 05 10:06 PM
Make it more simple or intuitive to do simple things Vernie Charts and Charting in Excel 1 March 16th 05 04:01 AM
simple question, hopefully a simple answer! Matt B Excel Programming 5 January 13th 04 08:43 PM


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