What I'm trying to do...
Get a button to automatically appear in cell H1 if there is something in cell A1. This is continued for multiple buttons down the column if more content is in the cells below A1. Each button when used will cut the contents of the cells from column A to G in the same row as the used button and paste them in the first blank row of another sheet and remove the used button.
First problem...
Adding a button in H1 if A1 is not blank. Remove/delete button in H1 if A1 is blank.
Edit 1:
Sub Macro1()
'
' Macro1 Macro
'
'
ActiveSheet.Buttons.Add(423.75, 0, 48, 15).Select
'ActiveSheet.Shapes("Button1").Name = "Button1"
Selection.Name = "Button1"
Selection.Characters.Text = "REMOVE"
With Selection.Characters(Start:=1, Length:=6).Font
.Name = "Calibri"
.FontStyle = "Regular"
.Size = 11
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 1
End With
End Sub
The problem is using an if statement to put multiple buttons, each with the name "Button" followed by the number of what row its in (Button1, Button2, etc).
Edit 2:
Title change.
Old - excel vba - add/remove buttons and cell range
New - excel vba - automatically add/delete buttons depending on cell values