Can anyone please help. I have the following code that works well except I am missing one part of what I need. My problem is I need to create the macro to open the newly created sheet and assign it to the newly created button. (see code below) I also need the newly created button to be placed below the last button created on sheet1.
Sub New_Contractor()
'
' New_Contractor Macro
'Creates a new sheet for a new contractor and names the sheet tab.
'
Sheet16.Visible = True
Sheet16.Select
Cells.Select
Selection.Copy
Sheets.Add After:=Sheets(Sheets.Count)
ActiveSheet.Paste
ActiveSheet.Name = InputBox("Please enter the name of the New Contractor")
Range("F4").Select
ActiveWindow.FreezePanes = True
Range("b4").Select
Sheet16.Visible = False
Sheet1.Select
Sheet1.Buttons.Add(191.25, 315, 95.25, 13.5).Select
***********code needed here to place button below the last button************
Selection.Characters.Text = Sheets(Sheets.Count).Name
Selection.OnAction =***********code needed here***********
With Selection.Characters(Start:=1, Length:=14).Font
.Name = "Calibri"
.FontStyle = "Regular"
.Size = 11
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 1
End With
Range("a1").Select
End Sub
Thanks to anybody who can help.
Bookmarks