Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Calling variable from user form

How would i add a variable which is defined in a workbook
from to a label on a userform?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Calling variable from user form

Hi Geraldon

You can use this event that will run when you open the userform

Private Sub UserForm_Initialize()
Me.Label1.Caption = Sheets("Sheet1").Range("A1").Value
End Sub



--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Geraldon" wrote in message ...
How would i add a variable which is defined in a workbook
from to a label on a userform?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Calling variable from user form

I'm not exactly sure what you're asking, but you can assign a
variable's contents to a label on a form with code like

Userform1.Label1.Caption = VarName

If you want to assign the value from a cell, use something like

Userform1.Label1.Caption = Worksheets("Sheet1").Range("A1").Text


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Geraldon" wrote in message
...
How would i add a variable which is defined in a workbook
from to a label on a userform?



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
Transfer variable to user Form jlclyde Excel Discussion (Misc queries) 2 April 23rd 10 08:25 PM
Calling name of Sheet as a Variable? thekeytothedoor Excel Worksheet Functions 1 January 1st 10 08:48 AM
Calling a procudure through variable name Basu Excel Discussion (Misc queries) 2 August 30th 06 08:55 AM
variable calling in different modules. russell Excel Programming 2 October 24th 03 04:17 AM
saveas calling a variable Douvid Excel Programming 6 July 28th 03 08:46 AM


All times are GMT +1. The time now is 01:35 PM.

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

About Us

"It's about Microsoft Excel"