Place button correctly

tigerdel

Board Regular
Joined
Oct 13, 2015
Messages
145
Office Version
  1. 365
Platform
  1. Windows
I have a shape linked to a macro. This shape appears when a cell in a table is selected and appears in column I
However, as you can see in the screenshot, it overlaps the cell above
The code used is:

Code:
Sub DisplayButtons()
With ActiveSheet
If Not IsEmpty(.Range("D" & ActiveCell.Row)) Then
With .Shapes("DelRowBtn")
.Visible = msoCTrue
.Left = ActiveSheet.Range("C" & ActiveCell.Row).Offset(0, 7).Left
.Top = ActiveSheet.Range("C" & ActiveCell.Row).Offset(0, 0).Top
.IncrementLeft -50
End With
Else
.Shapes("DelRowBtn").Visible = msoFalse
End If
End With
End Sub

Any help getting this to the left of the cell in column I gratefully received
 

Attachments

  • Delete button.png
    Delete button.png
    31.7 KB · Views: 4

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
@tigerdel Does the below help?

VBA Code:
Sub DisplayButtons()
Dim Shp As Shape
With ActiveSheet

If Not IsEmpty(.Range("D" & ActiveCell.Row)) Then
With .Shapes("DelRowBtn")
.Visible = msoCTrue
.Left = ActiveSheet.Range("I" & ActiveCell.Row).Left
.Top = ActiveSheet.Range("I" & ActiveCell.Row).Top
.Height = ActiveCell.RowHeight  '?????????
End With
Else
.Shapes("DelRowBtn").Visible = msoFalse
End If
End With
End Sub
 
Upvote 1
Solution

Forum statistics

Threads
1,215,358
Messages
6,124,487
Members
449,165
Latest member
ChipDude83

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top