Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 309
Default Inserting new rows into sheet

I am using the following code to insert a new row onto
my spreadsheet:

Rows("5:5").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove

This code will insert a new row above the current row number 5, which
is okay. My problem is that the new row has the same height and possibly
dimensions and formatting of row 4.

Can I basically tell Excel to insert a row of cells that are a default size
or
a size of my specification?? I dont want Excel to insert a row of cells
that
are the same dimensions of the above or below row. I realize that I could
write code to resize the new cells, but I am curious if Excel has a setting
to stop it from copying the dimensions of adjacent cells.

Thank you


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default Inserting new rows into sheet

Excel normally uses the default formatting when inserting a row,
however you're telling it to copy the format from the row above the
insertion point (via the optional
"CopyOrigin:=xlFormatFromLeftOrAbove" argument).

try simplifying your code to just: Rows("5:5").Insert
Shift:=xlDown
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 309
Default Inserting new rows into sheet

I must be doing something wrong, because that didn't work. I
tried both of the following options:

Rows("5:5").Insert

and

Rows("5:5").Insert Shift=xlDown


All cells in Row 4 have larger dimensions than all other cells on the
sheet. When I run the above code, Excel creates a row of cells that
all look like Row 4 cells.

Did I do something wrong???




"Jef Gorbach" wrote in message
...

try simplifying your code to just: Rows("5:5").Insert
Shift:=xlDown


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
Inserting rows on formula sheet? broop[_11_] Excel Discussion (Misc queries) 3 March 4th 09 08:23 PM
Cutting rows and inserting in another sheet Karen Bates Excel Discussion (Misc queries) 5 May 23rd 07 08:23 PM
inserting rows in entire sheet add Excel Discussion (Misc queries) 1 March 30th 07 04:10 PM
inserting rows at common word in a sheet Ankur Excel Discussion (Misc queries) 0 August 10th 05 11:18 AM
Inserting rows in protected sheet rajeshkumar Excel Programming 0 June 29th 05 03:29 PM


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