does excel know in which cell a button is located?
I can't speak for Jim, but his approach provided not only a solution, but
also instructed the OP on which object was being used thus further fostering
independent exploration as to the properties and methods of that object.
While not explicitly stated, it sets a foundation for continued actions with
the shape or perhaps passing a reference to the button to another procedure.
Also, if the OP tried typing in the suggestion, if a typo were made, it is
much more difficult to debug a single complex multi-qualifier line.
But showing the OP alternatives is useful as well.
--
Regards,
Tom Ogilvy
"Don Wiss" wrote in message
...
On Fri, 7 Oct 2005 15:05:34 -0700, Jim Cone
wrote:
Dim shpButton As Excel.Shape
Set shpButton = ActiveSheet.Shapes("Button 1")
shpButton.TopLeftCell.EntireRow.Insert
Set shpButton = Nothing
Why do you do this in four lines when it can simply be done in one?, i.e.
ActiveSheet.Shapes("Button 1").TopLeftCell.EntireRow.Insert
Don <www.donwiss.com (e-mail link at home page bottom).
|