ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Displaying cell values in a Userform (https://www.excelbanter.com/excel-discussion-misc-queries/92745-displaying-cell-values-userform.html)

michaelberrier

Displaying cell values in a Userform
 
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.


Daniel CHEN

Displaying cell values in a Userform
 

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
==================================
"michaelberrier" wrote in message
ups.com...
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.




michaelberrier

Displaying cell values in a Userform
 

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.


Harald Staff

Displaying cell values in a Userform
 
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

"michaelberrier" skrev i melding
oups.com...

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.





All times are GMT +1. The time now is 06:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com