Good afternoon all
Hope all had or is having a happy new year
I'm trying to add data from a user form to a specific sheet
I can do this but i don't want to see the target sheet
i want to remain on the current sheet
Private Sub CommandButton1_Click()
TargetSheet = ComboBox1.Value
If TargetSheet = "" Then
Exit Sub
End If
Worksheets(TargetSheet).Activate
lastrow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
ActiveSheet.Cells(lastrow + 1, 1).Value = TextBox1.Value
MsgBox ("DATA ADDED SUCCESSFULLY")
Unload Me
End Sub
Private Sub UserForm_Initialize()
With ComboBox1
.AddItem "NAMES"
.AddItem "JOBS"
.AddItem "PROCESSES"
.AddItem "FORMS"
End With
End Sub
Bookmarks