Displaying cell values in a Userform

M

michaelberrier

I know how to configure a UserForm to display values from a textbox in
a specific cell:

ActiveSheet.Range("A1") = TextBox.Text

What I would like to do is the opposite. To design a macro that
displays specific cell values in the textboxes of a UserForm that pops
up.

Any hope of that?

Thanks to all.
 
D

Daniel CHEN

The same way as

TextBox.Text = ActiveSheet.Range("A1")
OR
TextBox.Text = Sheets("shtname").range("A1")

-
Best regards,
---
Yongjun CHEN
==================================
- - - - www.XLDataSoft.com - - - -
Free Excel/VBA Tool & Training Material
==================================
 
M

michaelberrier

I'm guessing I put that in the UserForm code module? I've tried that
there and in a seperate module and cannot make it work.

Thanks for helping.
 
H

Harald Staff

You know WHAT you want to happen, and it is mostly solved

(there may be different results from these variations:
TextBox.Text = Sheets("shtname").range("A1")
TextBox.Text = Sheets("shtname").range("A1").Text
TextBox.Text = Sheets("shtname").range("A1").Value
)

but you haven't told HOW and WHEN you want this to happen. These
considerations decide where to put the code.

HTH. Best wishes Harald
 

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

Top