Userform with 5 textbox and 1 needs to refresh to have total

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hey

I have 5 text boxes which 1 of them has to be a running total of what has
been entered in. what I tried linking the 5 textboxs to a cell and then for
the one that i want to have the total in i have made its value = cell however
this does not seem to update. any ideas? i dont want the user to input this
textbox so i disabled it will that make a difference??

Any help will be appreicated
 
Try in your userform code:

Private Sub TextBox1_Change()
Me.TextBox5 = Val(Me.TextBox1) + Val(Me.TextBox2)+Val(Me.TextBox3) +
Val(Me.TextBox3)
End Sub

Repete this for each textbox 2-4

Then, to prevent the user from accessing Textbox5, don't Disable it.
Instead, in the userform design mode, Rt click the textbox>
Properties>Locked=True
 
Why not use the change event of each of the 4 textboxes to calculate the sum
and put that in textbox 5?

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top