Link from Userform to Spreadsheet

  • Thread starter Thread starter Richard
  • Start date Start date
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?
 
use

Private Sub CommandButton1_Click()
TextBox45.Text = Sheets("summary").Range("D38").Value
End Sub
 
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?
 

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