Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 577
Default Change one label in another form

I want to change a label in another form based on the user input from the
main form. Here is what I have tried but failed:
On the main form, the user choose "Good morning", "Good afternoon" or "Good
evening". The content is linked to a cell (say "A1") on Sheet1. Then the main
form is closed and another form, say UserForm1 is called. I want one label on
UserForm1 to show "Good morning", "Good afternoon" or "Good evening" based on
the input of the main form. On the main form I tried
UserForm1.show
UserForm1.Label1.Caption= Sheets("Sheet1").Range("A1").Value
The form UserForm1 pop up, but nothing happens to the label.

I'll appreciate your help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 523
Default Change one label in another form

Can you put

Me.Label1.Caption = Sheets("Sheet1").Range("A1").Value

In the initialize event for UserForm1?


"Scott" wrote:

I want to change a label in another form based on the user input from the
main form. Here is what I have tried but failed:
On the main form, the user choose "Good morning", "Good afternoon" or "Good
evening". The content is linked to a cell (say "A1") on Sheet1. Then the main
form is closed and another form, say UserForm1 is called. I want one label on
UserForm1 to show "Good morning", "Good afternoon" or "Good evening" based on
the input of the main form. On the main form I tried
UserForm1.show
UserForm1.Label1.Caption= Sheets("Sheet1").Range("A1").Value
The form UserForm1 pop up, but nothing happens to the label.

I'll appreciate your help.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 577
Default Change one label in another form

Sam, thanks a lot for you answer. I am not a programmer. I'm confused on
"the initialize event for UserForm1"

What's "the initialize event"? I just use "UserForm1.show" and the form
comes up. You mean I need "the initialize event"? And how to do that?

Many thanks.


"Sam Wilson" wrote:

Can you put

Me.Label1.Caption = Sheets("Sheet1").Range("A1").Value

In the initialize event for UserForm1?


"Scott" wrote:

I want to change a label in another form based on the user input from the
main form. Here is what I have tried but failed:
On the main form, the user choose "Good morning", "Good afternoon" or "Good
evening". The content is linked to a cell (say "A1") on Sheet1. Then the main
form is closed and another form, say UserForm1 is called. I want one label on
UserForm1 to show "Good morning", "Good afternoon" or "Good evening" based on
the input of the main form. On the main form I tried
UserForm1.show
UserForm1.Label1.Caption= Sheets("Sheet1").Range("A1").Value
The form UserForm1 pop up, but nothing happens to the label.

I'll appreciate your help.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Change one label in another form

From VBE window; from the left treevew right click the UserForm icon and View
Code. From the code panel 1st drop down select User form and form the second
drop down select Initialize event..1st drop down shows the controls and 2nd
one its events..

If this post helps click Yes
---------------
Jacob Skaria


"Scott" wrote:

Sam, thanks a lot for you answer. I am not a programmer. I'm confused on
"the initialize event for UserForm1"

What's "the initialize event"? I just use "UserForm1.show" and the form
comes up. You mean I need "the initialize event"? And how to do that?

Many thanks.


"Sam Wilson" wrote:

Can you put

Me.Label1.Caption = Sheets("Sheet1").Range("A1").Value

In the initialize event for UserForm1?


"Scott" wrote:

I want to change a label in another form based on the user input from the
main form. Here is what I have tried but failed:
On the main form, the user choose "Good morning", "Good afternoon" or "Good
evening". The content is linked to a cell (say "A1") on Sheet1. Then the main
form is closed and another form, say UserForm1 is called. I want one label on
UserForm1 to show "Good morning", "Good afternoon" or "Good evening" based on
the input of the main form. On the main form I tried
UserForm1.show
UserForm1.Label1.Caption= Sheets("Sheet1").Range("A1").Value
The form UserForm1 pop up, but nothing happens to the label.

I'll appreciate your help.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 577
Default Change one label in another form

Sam and Jacob, thank you both a lot. Problem is solved.

"Jacob Skaria" wrote:

From VBE window; from the left treevew right click the UserForm icon and View
Code. From the code panel 1st drop down select User form and form the second
drop down select Initialize event..1st drop down shows the controls and 2nd
one its events..

If this post helps click Yes
---------------
Jacob Skaria


"Scott" wrote:

Sam, thanks a lot for you answer. I am not a programmer. I'm confused on
"the initialize event for UserForm1"

What's "the initialize event"? I just use "UserForm1.show" and the form
comes up. You mean I need "the initialize event"? And how to do that?

Many thanks.


"Sam Wilson" wrote:

Can you put

Me.Label1.Caption = Sheets("Sheet1").Range("A1").Value

In the initialize event for UserForm1?


"Scott" wrote:

I want to change a label in another form based on the user input from the
main form. Here is what I have tried but failed:
On the main form, the user choose "Good morning", "Good afternoon" or "Good
evening". The content is linked to a cell (say "A1") on Sheet1. Then the main
form is closed and another form, say UserForm1 is called. I want one label on
UserForm1 to show "Good morning", "Good afternoon" or "Good evening" based on
the input of the main form. On the main form I tried
UserForm1.show
UserForm1.Label1.Caption= Sheets("Sheet1").Range("A1").Value
The form UserForm1 pop up, but nothing happens to the label.

I'll appreciate your help.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Label in a form alvin Kuiper Excel Programming 3 May 11th 09 08:41 AM
Label caption change on opening of form noord453 Excel Programming 1 May 5th 09 01:27 PM
Concatenate to form a label gwendalee Excel Discussion (Misc queries) 3 October 16th 07 12:59 AM
Hyperlink on a label in a VB Form Gaetan Excel Discussion (Misc queries) 4 May 28th 07 12:35 PM
COPY LABEL FORM FROM EXCEL TO A LABEL xrayAndi New Users to Excel 1 March 5th 06 02:21 PM


All times are GMT +1. The time now is 03:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"