Geekamo
asked on
Add Formula To Label Control on UserForm
Hello Experts,
I have a UserForm, that will eventually become a "popup" window that is splashed on the screen when the user opens the Excel Workbook.
I have added a "Label" control onto my UserForm, and I would like it to display the result of this formula:
="Version - "&LOOKUP(90000000000,'Chan ge Log'!A:A)&" (Jay Burke)"
I tried adding the formula right into the Label control, and it just shows the formula itself - not the result. So either, I need to do something else? Or it's just not something that is supported?
Thank you in advance for your help!
~ Geekamo
I have a UserForm, that will eventually become a "popup" window that is splashed on the screen when the user opens the Excel Workbook.
I have added a "Label" control onto my UserForm, and I would like it to display the result of this formula:
="Version - "&LOOKUP(90000000000,'Chan
I tried adding the formula right into the Label control, and it just shows the formula itself - not the result. So either, I need to do something else? Or it's just not something that is supported?
Thank you in advance for your help!
~ Geekamo
ASKER
Nope, doesn't work. It still just shows the formula.
You could set the caption to the value of the cell that has the formula.
Private Sub UserForm_Activate()
Label1.Caption = Sheets(5).Range("C3").Value
End Sub
ASKER
@ Graham,
Could you revise that formula to reference a named cell instead?
Could you revise that formula to reference a named cell instead?
and to paraphrase Syed
Label1 = "Version - " & Evaluate("=LOOKUP(90000000 000,'Macro '!A:A)") & " (Jay Burke)"
Regards
Label1 = "Version - " & Evaluate("=LOOKUP(90000000
Regards
Just plug the name into the code
Private Sub UserForm_Activate()
Label1.Caption = Sheets(5).Range("MyCell").Value
End Sub
ASKER
I'm not having any luck...
Can someone post a workbook that has a userform, and a label control is looking at a specific cell for it's value?
Hopefully that will help me out.
Can someone post a workbook that has a userform, and a label control is looking at a specific cell for it's value?
Hopefully that will help me out.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
@ GrahamSkan,
So weird, I couldn't figure out what I was doing wrong. Your version looked the same as mine - except I was referencing other names.
Anyhow, I copied and pasted yours - changed the names to this:
On your example that was referencing the named cell, I was wondering why it still needed to reference the sheet name. So on a hunch, I just removed it - and it's working perfectly.
Thank you very much for taking the time to help me with this!
~ Geekamo
So weird, I couldn't figure out what I was doing wrong. Your version looked the same as mine - except I was referencing other names.
Anyhow, I copied and pasted yours - changed the names to this:
Private Sub UserForm_Activate()
'Label1.Caption = Sheets(5).Range("C3")
lblVersion.Caption = Range("Version")
End Sub
On your example that was referencing the named cell, I was wondering why it still needed to reference the sheet name. So on a hunch, I just removed it - and it's working perfectly.
Thank you very much for taking the time to help me with this!
~ Geekamo
evaluate(="Version - "&LOOKUP(90000000000,'Chan