in reply to Re^2: Inserting copied rows at another position in Excel
in thread Inserting copied rows at another position in Excel
Simpler, possibly, but I don't find it more elegant. As I said, I always prefer to insert explicitly. This may be paranoia on my part, but I have seen spreadsheets go horribly wrong when the wrong insert method is used (compare the first two code examples in RFC Tutorial - Deleting Excel Rows, Columns and Sheets. Inserting and deleting have the same two - incompatible - options). There are spreadsheets I wrote over 20 years ago still used live even though they were written in 123, and I prefer to keep things very explicit. Can you be absolutely certain that, in Excel 2033, that $sht->$rngToTopLeft->Insert; of yours will work in exactly the same way? Probably you can. But with two types of insert currently available, I want readers of my code to be certain that I really mean the EntireRow type. It's worth noting that, in the OP, MerryMonk's recorded VBA uses the other type of insert.
As I say, this is probably paranoia. I'm certainly not going to the stake over it. But I avoid your insert command because, without testing, I can't be absolutely sure which insert is used or whether it is consistent from one version of Excel to another.
Regards,
John Davies
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Inserting copied rows at another position in Excel
by HelenCr (Monk) on Jan 12, 2013 at 14:49 UTC | |
by davies (Prior) on Jan 12, 2013 at 16:23 UTC | |
by HelenCr (Monk) on Jan 15, 2013 at 19:14 UTC |