Excel user form label caption based on a cell value

How do I get an Excel user form label caption to be based on the value of a cell in a particular worksheet?
Sandra SmithRetiredAsked:
Who is Participating?
 
zorvek (Kevin Jones)Connect With a Mentor ConsultantCommented:
There are two associated with "loading": Initialize and Activate. Initialize is called when the form is first loaded. Activate is called whenever the form is activated from an inactive state.

The subscript error is cause because you don't have a tab named "Sheet1". Change "Sheet1" to the tab name with the source cell.

Kevin
0
 
zorvek (Kevin Jones)ConsultantCommented:
You have to move the value. In the form's load routine:

   lblMyLabel = Sheets("Sheet1").[A1]

Kevin
0
 
Sandra SmithRetiredAuthor Commented:
Kevin, thanks, I'll try that.  Be right back.
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

 
Sandra SmithRetiredAuthor Commented:
I keep getting a Subsrcript Out of Range error.
0
 
Sandra SmithRetiredAuthor Commented:
By the way, where is the "Load" event for a form?  I could not see it in the drop-down for event procedures.
0
 
Sandra SmithRetiredAuthor Commented:
OK, let me try that.  I thought I had changed the tab name, but I would be wrong.  Be back.
0
 
Sandra SmithRetiredAuthor Commented:
Finally, got it!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.