Link from Userform to Spreadsheet

R

Richard

I aheva userform to calculate a project total depending on
the options picked using drop down boxes and checkboxes.

This all results in a sheet called "Summary" which lists
the components of the project and gives a total in cell
D38.

I want this total to be displayed on the userform, AS the
user is picking the options. i have a text box to show
this value, and thought i could just add a command button
next to it, with the following code:

TextBox45.ControlSource = "summary!D38"

This way i could just click on the button at any point and
see what the total was up to. what this does, however, is
overwrites the subtotal formula in cell D38.

So, two questions:
1- can i get the textbox to just look up the value in
D38, not replace it?

All help appreciated

Richard
2- can i get the textbox to update as i change the various
options?
 
Y

yogendra joshi

use

Private Sub CommandButton1_Click()
TextBox45.Text = Sheets("summary").Range("D38").Value
End Sub
 
R

Richard

Thanks, but this code still overwrites my cell D38. Is
there any way of not overwriting it, or resetting the
subtotal formula once the button hasbeen clicked?
 
Top