Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Jamil Akram   on Feb 12 In MS Office Category.

  
Question Answered By: Fairuzah Alam   on Feb 12

Sorry to be blunt, but your code  is very hard to understand.
It seems to have nested subs, some of which do nothing.

You said "as soon as I hit  Calculate or update  button", but
I don't see an calculate  or Update... I see what looks like an
"add" button, but all it does is sets the variable "ws" as
the worksheet called "data", then exits. ws is defined within the
sub, so it isn't even available outside the sub, nor is it used anywhere else.
I don't see ANY code that does any type of calculation.
The only thing I DO so is the commandbutton2 event that copies the
values to the sheet.

The answer to your question though is

Textbox3.value = textbox1.value + textbox2.value

You can also add this to the textbox_Change event to continually update
the value in textbox  3 without the need to hit a "calculate" button.

will add the contents of the first two boxes and put the result in the third
box.
If you put this in whatever click event you use for the "calculate" button,
it should display  the result in box 3...

hope this helps,

Share: 

 

This Question has 4 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on VBA TEXTBOX Or get search suggestion and latest updates.


Tagged: