Microsoft Excel - VBA TextBox - Asked By Rajender Prasad on 03-May-13 11:41 AM

Dear All,

I have 10 textboxes on a form..

I will input the value to them, and I click a button so that values of text boxes will be updated from A2 to J10.
And I will cear the values from textboxes.

I will repeat the same step one more time to compare the values that i have entered for the first and second time are same or not.

suppose, if textbix 5 value is not matching, then I should input only value for that instead of all textboxes.

can u please help in this case.


Harry Boughen replied to Rajender Prasad on 05-May-13 02:57 AM
Hello Prasad,
Would you not just compare the value in the textbox with the value in the appropriate cell and if they are different, set the value in the cell to match the value in the textbox.
The code would look something like:

For Each textbox in form
If textboxvalue <> cellvalue Then
cellvalue = textboxvalue
End If
Next textbox

Obviously you would have to name and set the appropriate parameters and arrange to increment through the cells as well.