MissZabrina
New Member
- Joined
- Feb 18, 2009
- Messages
- 1
Good Morning, I need some directions and ideas on how to write the codes to input data onto certain text boxes, then transfer the input data from the UserForm onto worksheet1. ANy input will be greatly appreicate and making my day!!!
If I have these text boxes: txtE, txtI, txtK.
By clicking the "OK" button "cmdOK" which will check if:
Any change to txtE.value, then the new value will be update onto cell E2 on worksheet1.
Any change to txtI.value, then the new value will be update onto cell I2 on worksheet1.
Any change to txtK.value, then the new value will be update onto cell K2 on worksheet1.
If I only changed the input value on txtE, but no change on txtI & txtK, will only update txtE and do nothing with txtI & txtK. The problem is, I am going to have more than 20 text boxes to do something like that, and I wan to find out a smart way to do this.
So, how do I write an if statement for the "OK" button to just perform the updating only when there is a change of the value on the specific textbox?
Would the codes be something like this? I have no idea...
</PRE>
Thanks a bunch!!!!
Zabrina
<!-- / message -->
If I have these text boxes: txtE, txtI, txtK.
By clicking the "OK" button "cmdOK" which will check if:
Any change to txtE.value, then the new value will be update onto cell E2 on worksheet1.
Any change to txtI.value, then the new value will be update onto cell I2 on worksheet1.
Any change to txtK.value, then the new value will be update onto cell K2 on worksheet1.
If I only changed the input value on txtE, but no change on txtI & txtK, will only update txtE and do nothing with txtI & txtK. The problem is, I am going to have more than 20 text boxes to do something like that, and I wan to find out a smart way to do this.
So, how do I write an if statement for the "OK" button to just perform the updating only when there is a change of the value on the specific textbox?
Would the codes be something like this? I have no idea...
Sub cmdOK
Sheet("worksheet1").Range("E2").Value = UserForm.txtE.Value.change
Sheet("worksheet1").Range("I2").Value = UserForm.txtI.Value.change
Sheet("worksheet1").Range("K2").Value = UserForm.txtK.Value.change
End Sub
Sheet("worksheet1").Range("E2").Value = UserForm.txtE.Value.change
Sheet("worksheet1").Range("I2").Value = UserForm.txtI.Value.change
Sheet("worksheet1").Range("K2").Value = UserForm.txtK.Value.change
End Sub
</PRE>
Thanks a bunch!!!!
Zabrina
<!-- / message -->
Last edited: