![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Location: Tennessee
Posts: 25
|
Hi All:
I'm using userforms now (thanks everyone for the help and ideas I.E.: When the form opens, Label2 = "Welcome to my form". After the user selects their name, Label2 = "Hello Dave, what would you like to do?" I tried the following code to set the label text when the form opens: Private Sub UserForm_Initialize() Startup_Form.Label2.Caption = Worksheets("List").Range("A65").Value End Sub When this code fires I get "Runtime error 9: Subscript out of Range" I'm using Rows A65-A75 (formated as text) to store data for the label. Any thoughts on what I'm doing wrong, or is there a better way to do this? Thanks Dave |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Apr 2002
Location: Vancouver BC , Canada
Posts: 6,259
|
This text does not have to be put in a cell , it can be hard coded in the form like this:
Private Sub UserForm_Initialize() Startup_Form.Label2.Caption = " Welcome to my Form" Or you could type it directly into the Properties section of the Caption item for the object. If how ever you want to put it in a cell check the address your using since the error your getting indicates it's not finding the information you want to enter. End Sub |
|
|
|
|
|
#3 |
|
New Member
Join Date: Mar 2002
Location: Tennessee
Posts: 25
|
Well, now I feel really stupid!! LOL
Worksheets("List").Range("A65").value Should have been Worksheets("Lists").Range("A65").value I have been looking at and working on this monster WAAAAYYYY to long.... Thanks Dave |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|