I have a button that asks for user input and a cell selection. The button also inserts a new row at the bottom of the table and is supposed to copy formulas down, but its not. When the user inputs the string, it should match an already existing sheet in the workbook. So I want to match the new cell with the name of existing sheet to create a hyperlink. That's not working either.
Private Sub NewWellButton_Click()
Dim well As Variant
Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Select
' Copy formula from cell above
Rows(Selection.Row).Insert Shift:=xlDown
ActiveCell.EntireRow.Copy
ActiveCell.EntireRow.PasteSpecial Paste:=xlPasteFormulas
Application.CutCopyMode = xlCopy
Dim ChosenRange As Range
Set ChosenRange = Application.InputBox(prompt:="Select the next empty cell in column A to input the well name.", Type:=8)
well = Application.InputBox("Enter the new well name", Title:="New Well")
ChosenRange.Value = UCase(well)
ActiveCell.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:=well
On Error Resume Next
MsgBox "Well names do not match to create hyperlink"
Exit Sub
End Sub