Interesting, on my copy of Excel and on the msdn online documentation, the
help page doesn't really describe the CopyOrigin argument, and entirely
omits mention of the Shift argument.
(http://msdn.microsoft.com/en-us/library/aa195769(office.11).aspx)
That aside, Rows(1).Insert Shift:=xlDown, CopyOrigin:=xlFormats doesn't do
the same thing as a row insert with "Format Same As Above" selected. This
code inserts a row above the specified row, using that row's formatting. In
other words, the flow of formatting is still "upwards."
What I want is to insert a row *below* the specified row, using that row's
formatting. In other words I start with this
+---------+
| AAA |
+---------+
| BBB |
+---------+
and want end up with this:
+---------+
| AAA |
+---------+
| aaa | <-- this is the new row
+---------+
| BBB |
+---------+
I want the names defined in row AAA its formulas and values to stay exactly
as they are.
I just want row aaa to have the same formatting as AAA (borders,
interior,protection, cell format, etc).
Using Rows(1).Insert Shift:=xlDown, CopyOrigin:=xlFormats I get this
+---------+
| aaa | <-- this is the new row
+---------+
| AAA |
+---------+
| BBB |
+---------+
Any other ideas on how to programmatically control the Format Same As Above
setting?
Brian
"Office_Novice" <(E-Mail Removed)> wrote...
> Try somthing like
> Rows(1).Insert Shift:=xlDown, CopyOrigin:=xlFormats
|