Userform help

zigaria1

New Member
Joined
Jun 8, 2011
Messages
1
Ok, long story short, i have a userform named "UserFormSPHIX" and I need to set that equal to some type of object or variable named "oUserForm" so that the following piece of code will execute properly:

oUserForm.Label1.Caption = "generic string of text"

The code i currently have looks like this:

Dim oUserForm as UserForm
set oUserForm = UserFormSPHIX

oUserForm.Label1.Caption = "generic string of text"

however, this does not change the caption of label1. It doesn't give me any error message, it just doesn't do anything! Any help would be GREATLY appreciated!
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Welcome to the board!

I've only very recently made my first userform. I had some difficulties also though... Try doing this instead:

Code:
dim oUserForm as Object
set oUserForm = new UserFormSPHIX
 
oUserForm.Show
 
oUserForm.Label1.Caption = "generic string of text"

Hopefully it helps - I don't fully understand the issue so can't offer explanations but hoping someone with more experience on the subject will chime in and enlighten us both.

Tai
 
Upvote 0

Forum statistics

Threads
1,224,595
Messages
6,179,798
Members
452,943
Latest member
Newbie4296

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top