Excel Vba Move A Shape To The Last Row

[Solved] Excel Vba Move A Shape To The Last Row | Vb - Code Explorer | yomemimo.com
Question : excel vba Move a shape to the last row

Answered by :

Sub MoveButton()
Dim ws As Worksheet
Dim lr As Long
Dim buttonCell As Range
Dim shp As Shape
Set ws = Sheets("Sheet1") 'Sheet where shape is inserted
lr = ws.Cells(Rows.Count, 1).End(xlUp).Row + 1 'first empty row in column A
Set buttonCell = ws.Cells(lr, "A") 'setting the cell where button will be placed
Set shp = ws.Shapes("myShape") 'name of the shape is "myShape", change it as per your requirement
'set the shape dimensions
With shp .Left = buttonCell.Left .Top = buttonCell.Top
End With
End Sub

Source : https://stackoverflow.com/questions/43626073/move-a-shape-to-the-last-row | Last Update : Mon, 02 May 22

Answers related to excel vba move a shape to the last row

Code Explorer Popular Question For Vb