Hi,
Once again I hit a brick wall after having spent all morning trying to figure it out I come to you, MrExcel Forumites.
Below I present my code thus far - it all works as intended. What I need to now do is add the following line to the Command Button created in the code -
Simple enough one would think. But due to the dynamic nature of the buttons name I am hitting a brick wall.
Please help.
Once again I hit a brick wall after having spent all morning trying to figure it out I come to you, MrExcel Forumites.
Below I present my code thus far - it all works as intended. What I need to now do is add the following line to the Command Button created in the code -
Code:
UserForm2.Show
Simple enough one would think. But due to the dynamic nature of the buttons name I am hitting a brick wall.
Please help.
Code:
Sub New_Applicant()
Dim shp As Shape
NewRow = Sheets("Applications").Cells(Rows.Count, 2).End(xlUp).Row + 1
OldRow = Sheets("Applications").Cells(Rows.Count, 2).End(xlUp).Row
Set Rng = Sheets("Applications").Range("A" & NewRow)
With Sheets("Applications")
.Range("A" & OldRow & ":BM" & OldRow).Copy
.Range("A" & NewRow & ":BM" & NewRow).PasteSpecial xlAll
.Range("B" & NewRow & ",T" & NewRow & ",AL" & NewRow & ":AN" & NewRow & ",AP" _
& NewRow & ":BM" & NewRow).ClearContents
.Range("B" & NewRow & ":B" & NewRow) = UserForm1.TextBox1.Value
.Range("J" & NewRow & ":J" & NewRow) = UserForm1.TextBox2.Value
.OLEObjects.Add(ClassType:="Forms.CommandButton.1", Left:=Rng.Left, Top:=Rng.Top, _
Width:=Rng.Width, Height:=Rng.RowHeight).Select
Set shp = ActiveSheet.Shapes(Selection.Name)
With shp.OLEFormat.Object
.Object.Caption = ""
End With
shp.Name = "Add" & NewRow
End With
End Sub