Hi, I have a button where I add a new column after a specific column. In my case H.
After adding one column, the user can add more columns, and these should be to he right of the last added column.
Private Sub add_quantity_Click()
ActiveSheet.Unprotect
Columns("H:H").Insert
Range("H5").Select
Selection.Locked = True
Range("H6").Select
Selection.Locked = False
Range("H7").Select
Selection.Locked = False
Range("H7").Select
Selection.NumberFormat = "0.00"
ActiveSheet.Range("H2").Select
With ActiveSheet.Buttons.Add(Selection.Left, Selection.Top, Selection.Width, Selection.Height)
.OnAction = "delete_quantity_click"
.Characters.Text = "Delete"
End With
Application.ScreenUpdating = True
ActiveWorkbook.Save
ActiveSheet.Protect
End Sub
See attached pictures... 1, 2, and 3
1.png
2.png
3.png
Bookmarks