![]() |
Link from Userform to Spreadsheet
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? |
Link from Userform to Spreadsheet
use
Private Sub CommandButton1_Click() TextBox45.Text = Sheets("summary").Range("D38").Value End Sub Richard wrote: 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? |
Link from Userform to Spreadsheet
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? -----Original Message----- use Private Sub CommandButton1_Click() TextBox45.Text = Sheets("summary").Range("D38").Value End Sub Richard wrote: 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? . |
Link from Userform to Spreadsheet
don't link the textbox to cell D38.
-- Regards, Tom Ogilvy "Richard" wrote in message ... 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? -----Original Message----- use Private Sub CommandButton1_Click() TextBox45.Text = Sheets("summary").Range("D38").Value End Sub Richard wrote: 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? . |
All times are GMT +1. The time now is 11:05 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com