View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Office_Novice Office_Novice is offline
external usenet poster
 
Posts: 245
Default Can I set Insert Options programmatically?

Try somthing like
'Everytime the cell changes this will insert a new formated row
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Rows(1).Insert Shift:=xlDown, CopyOrigin:=xlFormats
End Sub


"Brian Knittel" wrote:

Is there a way to set the row Insert Options programmatically in Excel 2003?
I haven't been able to find any object that encompasses this.

What I want is to to be able to have a macro insert a row using the "Format
Same As Above" option, but I don't want the user to have to set this
manually or have to live with the option set if they don't want to. What I
want to do is save the original setting, change it to Format Same As Above,
insert the row, then restore the original setting.

Of course I can copy the various properties from the cells in the row above,
but it's not as nice as having the row just pop into place ready to go.

Any advice would be greatly appreciated.

Brian