dirtychinch
06-24-2014, 06:13 AM
Hi all,
I want to create a method of quickly updating a series of prices based on their product code. I have a form which pops up and asks for the product code and new price. This is the code I've written to do it, but no prices ever change.
Sub PriceChange()
Dim A As Integer, B As Variant, Cell As Range, TextBox1, TextBox2 As TextBox
For Each Cell In Range("ProductCodes")
If Cell.Value = UserForm1.TextBox1.Value Then
Cell.Offset(0, 1).Value = UserForm1.TextBox2
End If
Next
UserForm1.Hide
MsgBox ("The pricing update has been carried out.")
End Sub
Could anyone enlighten me?
Thanks,
Jonathon
I want to create a method of quickly updating a series of prices based on their product code. I have a form which pops up and asks for the product code and new price. This is the code I've written to do it, but no prices ever change.
Sub PriceChange()
Dim A As Integer, B As Variant, Cell As Range, TextBox1, TextBox2 As TextBox
For Each Cell In Range("ProductCodes")
If Cell.Value = UserForm1.TextBox1.Value Then
Cell.Offset(0, 1).Value = UserForm1.TextBox2
End If
Next
UserForm1.Hide
MsgBox ("The pricing update has been carried out.")
End Sub
Could anyone enlighten me?
Thanks,
Jonathon