Display Text & value of Cell on Userform

Lexian

New Member
Joined
Dec 14, 2017
Messages
5
Hi,

I have a UserForm and a Label. When the Userform is open. I want the Label to Display:

"Welcome to Mining Matrix"

but the word Matrix comes from different Worksheet. so meaning you can change the word matrix from that sheet.


Thanks in advance
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
something like this?

Code:
Private Sub UserForm_Initialize()
Label1.Caption = "Welcome to Mining " & Sheets("Sheet1").Cells(1, 1).Value
End Sub
 
Upvote 0
1. Give some understandable name to Label1, say, Grt (like greeting); don't use anonymous names like CommandButton138, Label17, ...
2. Put the constant text "Welcome to Mining " on Grt (put it in the Caption property)
3. Give a name to the cell A1 in Sheet1, say, mtrx; don't use absolute as-long-as-Mississippi references.
Then

Code:
Private Sub UserForm_Initialize()
Grt = Grt & [mtrx].Text
[COLOR=#008000]'Use benefits of default properties; the Caption property is the default one for labels.
'Use the Text property when you need string, not the variant Value[/COLOR]
End Sub



 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,254
Members
452,623
Latest member
Techenthusiast

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top