copy text from cells into different textboxes

  • Thread starter Thread starter JazzyXXL
  • Start date Start date
J

JazzyXXL

hi all,
I am a beginner concerning VBA scripting and I have following task:
I have got a flowsheet diagram of a process drawn in Excel. Further,
Excel calculates the single streams of the process (mass flows and
concentrations). This data is written into several cells in the
worksheet. What I want to do is to automatically update the values
from the cells into textboxes that are attached to the flowsheet
diagram. The problem I have is that I do not know how to address the
existing textboxes with VBA. Could somebody give me a hint?
Thanks,
Luca
 
Assuming the TextBox is from the Control ToolBox. As an example:

Sheets(1).TextBox1.Text = Sheets(1).Range("A1").Value

Would place the data in Cell A1 into TextBox 1.
 
Okay. But how do I address the textboxes? I have to set the variable
TextBox1 somehow and link it to one of the several textboxes spread on
the worksheet. That's actually my main problem...
 
TextBox1 is an Object Name, not a variable. But maybe if you explained what
you are trying to do, it would help to determine a better solution.
 
I'll try to explain in more detail what I plan to do.
I have got a table like the following containing the composition of
several streams in a chemical process:

component stream 1 stream 2 stream 3 ...
COMP1 1 t/h 0.2 t/h ....
COMP2 0.5 t/h ....
COMP3 2 t/h ....
....

Further I have a flowsheet of the process as for example shown here:
http://de.wikipedia.org/wiki/RI-Fließbild.

What I want to do is to draw textboxes for each stream into this
flowsheet and copy the content from the table into the respective
textbox.

Since I will run several simulations I would like to update the data
in the textboxes without having to redraw and replace them.
A sub or function of this type would be nice:

update_textbox(textbox_ID As WhatEver, cells_to_copy_into_textbox As
Range)

Thanks for suggestions

Luca
 

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