Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Insert Row without Selecting

I'd like to be able to insert a new row without having to
select a row first. This is the syntax I'm using (from a
recorded macro):

TargCell.EntireRow.Select
Selection.Insert Shift:=xlDown

I don't want to have to do a select because the sheet I'm
manipulating is (windows(sheetname).visible = false), and
currently I have to "unhide" it in order to insert the
row, or I get an error trying to do the select when it's
hidden.

Any help would be appreciated.

David Jenkins
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Insert Row without Selecting

Hi David,

David Jenkins wrote:
I'd like to be able to insert a new row without having to
select a row first. This is the syntax I'm using (from a
recorded macro):

TargCell.EntireRow.Select
Selection.Insert Shift:=xlDown

I don't want to have to do a select because the sheet I'm
manipulating is (windows(sheetname).visible = false), and
currently I have to "unhide" it in order to insert the
row, or I get an error trying to do the select when it's
hidden.


TargCell.EntireRow.Insert Shift:=xlDown

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Insert Row without Selecting

Beautiful! Thanks, Jake!


-----Original Message-----
Hi David,

David Jenkins wrote:
I'd like to be able to insert a new row without having

to
select a row first. This is the syntax I'm using (from

a
recorded macro):

TargCell.EntireRow.Select
Selection.Insert Shift:=xlDown

I don't want to have to do a select because the sheet

I'm
manipulating is (windows(sheetname).visible = false),

and
currently I have to "unhide" it in order to insert the
row, or I get an error trying to do the select when it's
hidden.


TargCell.EntireRow.Insert Shift:=xlDown

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address

unmonitored]
.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Insert Row without Selecting

Worksheets(SheetName).Rows("10:10").EntireRow.Inse rt

- Manges

--
Message posted from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Insert Row without Selecting

Worksheets(SheetName).Rows("10:10").EntireRow.Inse rt

if you try to select a hidden sheet you get an error. so do not use
select. use the insert directly. The above line inserts row 10

- Manges

--
Message posted from http://www.ExcelForum.com

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
Cannot insert worksheet in exel - not available in insert menu pedro39 Excel Worksheet Functions 1 July 24th 08 12:09 PM
insert row / insert column command buttons fairgreen Excel Worksheet Functions 1 October 29th 07 02:41 PM
Can I auto insert a worksheet when I insert a value in a cell. iainc Excel Worksheet Functions 0 April 27th 06 08:37 AM
Insert Next? Or insert a variable number of records...how? Tom MacKay Excel Discussion (Misc queries) 0 April 20th 06 10:44 PM
Selecting ALL names when using Insert/Names/Apply Mike Excel Worksheet Functions 3 April 23rd 05 05:20 PM


All times are GMT +1. The time now is 03:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"