View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Don Wiss Don Wiss is offline
external usenet poster
 
Posts: 300
Default does excel know in which cell a button is located?

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).