Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Excel user form label caption based on a cell value

Posted on 2007-07-20
7
Medium Priority
?
1,503 Views
Last Modified: 2013-11-25
How do I get an Excel user form label caption to be based on the value of a cell in a particular worksheet?
0
Comment
Question by:ssmith94015
  • 5
  • 2
7 Comments
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 19531952
You have to move the value. In the form's load routine:

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

Kevin
0
 

Author Comment

by:ssmith94015
ID: 19532128
Kevin, thanks, I'll try that.  Be right back.
0
 

Author Comment

by:ssmith94015
ID: 19532343
I keep getting a Subsrcript Out of Range error.
0
NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

 

Author Comment

by:ssmith94015
ID: 19532377
By the way, where is the "Load" event for a form?  I could not see it in the drop-down for event procedures.
0
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 2000 total points
ID: 19532717
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
 

Author Comment

by:ssmith94015
ID: 19534172
OK, let me try that.  I thought I had changed the tab name, but I would be wrong.  Be back.
0
 

Author Comment

by:ssmith94015
ID: 19534246
Finally, got it!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question