Must have done something wrong as all I am getting on anything other than "stock"
is negative 1 in column 3 (instead of the negative value of what was inputted into
the userform textbox2 (But I'm a step closer it think lol.
Thanks again Ragulduy but can you see what I did wrong. Code snippet below .
Sub AddData()
With Sheet1
NextRw = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
.Cells(NextRw, 1).Value = UserForm1.TextBox1.Value
.Cells(NextRw, 2).Value = Date
If Strings.Left(UserForm1.TextBox1.Value, 3) = "stock" Then
.Cells(NextRw, 3).Value = UserForm1.TextBox2.Value
Else
.Cells(NextRw, 3).Value = -1
End If
.Cells(NextRw, 4).Value = UserForm1.TextBox3.Value
.Cells(NextRw, 5).Value = UserForm1.TextBox4.Value
.Cells(NextRw, 6).Value = UserForm1.TextBox5.Value
.Cells(NextRw, 7).Value = UserForm1.TextBox6.Value
.Cells(NextRw, 8).Value = UserForm1.TextBox7.Value
.Cells(NextRw, 9).Value = UserForm1.TextBox8.Value
.Cells(NextRw, 10).Value = UserForm1.TextBox9.Value
.Cells(NextRw, 11).Value = UserForm1.TextBox10.Value
MsgBox "Entry Added"
End With
End Sub
Bookmarks