Get control of a Userform by the Name

I want to change the text of a form.
I know the name of the form and the name of the control in it.

How to get the control of a form if I know the Name?

Below post refers to adding a form. But I already have a form, just
need the control of that!
http://groups.google.co.in/group/microsoft.public.excel.programming/browse_thread/thread/beedb666e1d7a29b/f2df993ded867dd4?hl=en&lnk=gst&q=form+by+name#f2df993ded867dd4

Thanks a lot in advance

Regards'
Joe
0
Joe
5/21/2010 11:28:06 AM
excel.programming 6508 articles. 2 followers. Follow

5 Replies
935 Views

Similar Articles

[PageSpeed] 5

If you are talking about a VBA user from in VBA window press F4 (View
properties window) and click on the control.  The name will be in the
Name property.

If you have a worksheet user form you should be able to click on the
object and the name will be in the box next to the formula box (fx)


-- 
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?u=229
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=204280

http://www.thecodecage.com/forumz

0
joel
5/21/2010 12:28:41 PM
But I need it in runtime !
0
Joe
5/21/2010 12:43:27 PM
On May 21, 4:28=A0pm, Joe <joe.varghese.j...@gmail.com> wrote:
> I want to change the text of a form.
> I know the name of the form and the name of the control in it.
>
> How to get the control of a form if I know the Name?
>
> Below post refers to adding a form. But I already have a form, just
> need the control of that!http://groups.google.co.in/group/microsoft.publi=
c.excel.programming/b...
>
> Thanks a lot in advance
>
> Regards'
> Joe

I got a very Nice Link...
http://www.cpearson.com/excel/ShowAnyForm.htm

I am trying it out...
0
Joe
5/21/2010 12:44:08 PM
Your description is somewhat confusing... can you give more detail about 
what you are actually trying to do?

-- 
Rick (MVP - Excel)



"Joe" <joe.varghese.john@gmail.com> wrote in message 
news:aa0afd18-fcb5-41e8-9324-cb94cf3c3352@u3g2000prl.googlegroups.com...
> I want to change the text of a form.
> I know the name of the form and the name of the control in it.
>
> How to get the control of a form if I know the Name?
>
> Below post refers to adding a form. But I already have a form, just
> need the control of that!
> http://groups.google.co.in/group/microsoft.public.excel.programming/browse_thread/thread/beedb666e1d7a29b/f2df993ded867dd4?hl=en&lnk=gst&q=form+by+name#f2df993ded867dd4
>
> Thanks a lot in advance
>
> Regards'
> Joe 

0
Rick
5/21/2010 3:25:36 PM
>I want to change the text of a form.

What do you mean by the "text of a form"? I will assume you mean the
Caption that appears on the title bar of the form.

Try some code like the following:

Sub ChangeCaption()
    Dim FormName As String
    Dim NewCaption As String
    Dim UF As UserForm
    Dim N As Long
    Dim B As Boolean
    FormName = "UserForm2"
    NewCaption = "This Is New"
    Load UserForm1
    
    VBA.UserForms.Add FormName
    
    For N = 0 To VBA.UserForms.Count - 1
        If StrComp(VBA.UserForms(N).Name, FormName, _
                vbTextCompare) = 0 Then
            VBA.UserForms(N).Caption = NewCaption
            B = True
            Exit For
         End If
    Next N
    If B = True Then
        VBA.UserForms(N).Show
    End If
End Sub


The form whose caption you want to change must already be loaded into
memory, but not necessarily visible. To load a form into memory
without making it visible, use either of

Load UserForm2

' OR

VBA.UserForms.Add "UserForm2"


Cordially,
Chip Pearson
Microsoft Most Valuable Professional,
	Excel, 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com



On Fri, 21 May 2010 04:28:06 -0700 (PDT), Joe
<joe.varghese.john@gmail.com> wrote:

>I want to change the text of a form.
>I know the name of the form and the name of the control in it.
>
>How to get the control of a form if I know the Name?
>
>Below post refers to adding a form. But I already have a form, just
>need the control of that!
>http://groups.google.co.in/group/microsoft.public.excel.programming/browse_thread/thread/beedb666e1d7a29b/f2df993ded867dd4?hl=en&lnk=gst&q=form+by+name#f2df993ded867dd4
>
>Thanks a lot in advance
>
>Regards'
>Joe
0
Chip
5/21/2010 5:52:36 PM
Reply:

Similar Artilces:

Can I get menus in 2007
Is there any way to get a menu bar w/ word 2007? I like 2007 but the choices in the tabs are not sufficient and I have to fight to get the function I need. thanks john Add what you want to the Quick Access Toolbar. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP, originally posted via msnews.microsoft.com "John Coltrane" <tendengarci@yahoo.com> wrote in message news:ejbigfJ5KHA.5808@TK2MSFTNGP02.phx.gbl... > Is there any way to get a menu bar w/...

Where can I get a free Inventory control spreadsheet
I am looking for a Inventory/Stock control excel template, but I don' want to pay for it!!!!!! Can anyone suggest a sit -- Message posted from http://www.ExcelForum.com You can search in Google, using keywords like Excel and Inventory. Or look at the templates on the Microsoft web site: http://office.microsoft.com/templates/default.aspx Pritch14 < wrote: > I am looking for a Inventory/Stock control excel template, but I don't > want to pay for it!!!!!! > > Can anyone suggest a site -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/...

Naming Ranges #4
Hi, When I name a Range on Sheet1, then make a Copy of Sheet1 to say Sheet2, then access the Define Names dialogbox, I can see the named Range listed twice. One is noted as belonging specifically to Sheet2 and the other appears without a sheet reference. When assiging a name to a Range, can I specify that it belongs to a certain sheet? Also, how would I change this code to assign the sheet name aswell? ActiveWorkbook.Names.Add Name:="myRange", RefersToR1C1:="=Sheet1!R1C1:R10C1" I am trying to assign a the name 'Column_Header_Range' to each sheet in my work...

suggest names (outlook 2002)
in the autocomplete function, is there a way to access the database? I've got old addresses in there that I used once a year ago causing a drop-down list when I've only got one matching entry in my address book... so what I'd like to do is either clear it out completely or at least delete the obsolete entries, I've looked in the registry and it isn't there... any suggestions would be appreciated, thanks! --John Remove individual addresses from the autocompletion cache by highlighting the entry when presented in the suggested names list (use your arrow key to migrate to...

Get $500 to your PAYPAL Account by just one CLICK)
i have hidden the form of getting $500 to your PAYPAL ACCOUNT....CLICK on the IMAGE which is on the RIGHT SIDE of the website http://tricks-4u.4-all.org/ ...

why do i get #### in my formula cell?
I don't really know much about Excel, and my formula (it's just simple arithmetic formulas) returns with ##### displayed on the cell, with a tooltip showing the cell's correct value when I hover over it. airn, make the column wider and see if that helps -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2002 & 2003 "airn" <airn@discussions.microsoft.com> wrote in message news:C6F4DD7C-3D7D-475C-894D-0F7745735666@microso...

How do I get focus back on an Excel file?
When automating Excel, if there is a picture (graphic) on the worksheet, when the file is opened, the picture has the focus and mouse-clicks anywhere on the Excel window are lost. Is there a way to get the focus back so that other cells can be editted? Insert this line of code into the macro: ActiveSheet.Range("A1").Select You could also rework the code to avoid selecting the shape in the first place. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ "Stumpiana" <Stumpiana...

Installed Exchange 2003 Server on new Hardwar... How to get rid of old Exchange 2000 Server?
Hi, Our single domain company (Win 2000 DC's) was running a single Exchange 2000 server. I bought a new server, installed Windows 2003 Server on it, joined it to the domian (non-DC) and then installed Exchange 2003 Server on that and joined it to the site. I then pointed our MX records towards the new box. As soon as I verified connectivity, I began moving user's mailboxes over 1 by 1. Everyone is now running smoothly on the new server. I have not as of yet removed the old server (still on, running, no mialboxes). The problem is, that as soon as I turn off the old Exchange 2000 s...

Where free 2 sigma statistical process control chart, free?
where can I download a free statistical process control chart template? ...

Controlling Gap Width for BAR Chart
Hi, I have the following data for example. A = 2 B= 3 C = 4 I can create a 2 D Bar chart from this quite easily. Now If I make the data to A = 2 , 3 B= 3 , 4 C = 4 , 5 I do want to plot the data on the basis of first two values as mentioned in the first example, but I want to control the width of the Bar from the value given after comma. Please help. On Sat, 24 Feb 2007, in microsoft.public.excel.charting, Fazi <farazahmedtoor@gmail.com> said: >I have the following data for example. >A = 2 , 3 >B= 3 , 4 >C = 4 , 5 > >I want to plot the data on the basis of firs...

How do I get the data/xml/export option
My export option is disabled under data/xml tab. What is the exact feature I need to install to get this export xml option. I didn't install all the option during excel installation. Which specific install tab are required during excel installation? thanks Nick One way would be to do a web query, first preformat the cells as text, then do the query (data>import external data>new web query), put in the web site address, select the part you want to import, under properties select preserve cell formatting and do the import -- Regards, Peo Sjoblom (No private emails pleas...

Getting to grips with MOOL
Hi, I've bought, downloaded and installed MOOL, only to find it's not quite what I thought (I know some others have been disappointed by the reality vs representation), but more importantly that there's really no guidance on using it. I'm quite surprised how difficult I'm finding it as I've never struggled with any non-specialist applications before, but perhaps I'm just ageing badly! Anyway, can anyone give me a simple guide to getting going? What I would like: Basically I'd like something rather like Exchange. I (now) understand that MOOL won't do ...

Tab Control #7
Hi, I'm using a basic tab control, how to place a bitmap image onto it ? Can a bitmap image be inserted only on the tab strips. (what i mean by tab strips is the part of tab, which holds name for that tab). Also, how to get the 3D effect for the tab ? (Like XP tabs) Hi You can bitblt for each tab clicks. I mean when you change the tab just repaint the dialog with new bitmap. Best regards, Amal Quote raj: Can a bitmap image be inserted only on the tab strips. (what i mean by tab strips is the part of tab, which holds name for that tab). ------------------------------------- Y...

Can't get newsgroup messages posted by self
I have a weird issue with Windows Live Mail concerting synchronizing messages from newsgroups. If I post a message to the Microsoft private newsgroups (privatenews.microsoft.com), I don't see the post but I can see new posts by other users. If I use Outlook Express on Windows XP, I see my posts. I don't have problems with WLM synchronizing my hotmail e-mail. Any idea how I can troubleshoot this issue? "Teo Lachev" <TeoLachev@discussions.microsoft.com> wrote in message news:65458221-D220-47D9-95E3-A9B593424714@microsoft.com... > I have a weird issu...

Button form control does not work
I have spent over 5 hours trying to get the button wizard to do a simple thing. Open a form and show data in that form that matches the name in the form where the button is but when i follow the wizard the button allways go to the first entary in the second form eg i have the form (form1) open on emma (record 3) and want to open a second form that also contains emma the wizard puts the following in to a macro form2, Form, , "[Full Name]=" & [Full Name], , Normal but when i test the button it open the second form with the first record which is not emma why d...

Windows Mail spelling control Dutch
Spelling control of my Windows Mail (Version 6.0.6000.16386 / Vista_rtm.061101-2205) is presently limited to English, French, German, Spanish. I want to include spelling control for Dutch. I received below advise, but after donwload and installation of the most recent version of Wlndows Live, no upgrade to below mentioned latest version has happened, nor is there a complement of 37 spell check languages. ********************** Make sure you have the latest version (14.0.8089.0726), and you have to be online to see the full complement of 37 spell check languages. ****************...

attachment getting stripped off
I have Outlook 2000 and every time I origionate an email from my home computer with an attachment it gets stripped off before it gets to the addressee. I can foward emails with attachments and they stick. Any tips M are you using RTF format? if so, switch to plain text and see if it helps. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, Visual Quick Start Guide - OneNote 2003 Outlook Tips: http://www.outlook-tips.net/ http://www.poremsky.com - http://www.cdolive.com Expert Zone http://www.microsoft.com/windowsxp/expertzone Search for answe...

Help, how do I get an exe file with outlook 2002.
is there a way to turn off the GD stupid F#@$ing level one interecept "feature" in outlook? I am so angry with this stupid program@! I need to download an exe file and cannot with this software! Maybe if you washed your mouth out with soap, someone would be willing to help you. This is a technical forum -- not a place for ranting fools. "Sean" <sean@pointblankinc.com> wrote in message news:5a8001c42d8f$52c08b20$a401280a@phx.gbl... > is there a way to turn off the GD stupid F#@$ing level > one interecept "feature" in outlook? > > I am so angr...

Trying to get a type of video file format to open and run on my we
I created a video using Windows Movie maker and saved as .wmp file. I saved it to my computer and then inserted on my web page under Front Page 2003. Nothing! I then converted the file to avi format - still nothing! I then tried mpeg4 still nothing. The manual is next to useless on this subject. Anyone tell me what I need to do so that when a user opens up the page the video plays automatically. -- Simon Holloway Save as a .wmv and insert a suitable player into the page. For IE only, Insert->Web Component->Advanced Controls->ActiveX Control Click Next Choose Window...

get network login name
I have the following code to get the network login name: Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _ "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long Function fOSUserName() As String ' Returns the network login name Dim lngLen As Long, lngX As Long Dim strUserName As String strUserName = String$(254, 0) lngLen = 255 lngX = apiGetUserName(strUserName, lngLen) If lngX <> 0 Then fOSUserName = Left$(strUserName, lngLen - 1) Else fOSUserName = vbNullString End If E...

How to control what tabs are displayed in Active Directory Users and Computers
I do not see the value to allow the delegate to change the City, State, Country, Office. What am I doing wrong. (see info below) Also is there a way to limit the view of what is shown in Active Directory users and computers, so the Delegate only sees the General, Address, Telephone and Organization tabs? I know the step below lock them out of the other tabs, but there would be less confusion..even if it is registry hack on that local pc. Here are the steps I have done so far: Step 1. Create a Security Group Called 'XYZ' (call it what ever you want Step 2. Open Active Directory User...

Corporate Name Change
How does one change the name of a stock (and symbol) when a company (such as AOL) decides to do so Wade: Select AOL from your portfolio, right click and choose "see details" You can rename it and change the symbol there. Kevin "Wade" <anonymous@discussions.microsoft.com> wrote in message news:023701c395d4$c6129da0$a401280a@phx.gbl... > How does one change the name of a stock (and symbol) when > a company (such as AOL) decides to do so Thanks ... I get an error stating the ticker is already in use. How can I get around this (is there a global ticker li...

Getting cells to automatically delete spaces
Hi all I have got a very large spreadsheet where the information is presente as: 111111/ 1 Notice the two spaces after the forward slash. There's about 10'00 cells in the column with varying numbers but all in the above format. I need to get the two spaces deled so that it will appear as: 111111/1 Is there a way i can get excel to proccess this for me. Any help will be much appreciated. Thanks in advance. Darre -- Message posted from http://www.ExcelForum.com Darren, Select the required area or a whole sheet, and do a simple Replace (Edit menu), asking Excel to replace s...

Why am I still getting SPAM?
I am getting unsolicited pop up advertisements when I start Money 2003 Standard Ed. Somehow the "turn off sponsorship & shopping..." box keeps getting unchecked! HOW? WHY? I PAID for this software. I wouldn't mind so much if it was free, but advertisements MUST come with free content of some sort. This is enough to make me change to another software package. ' Based on a finding reported in another thread, you might try turning off Money Express, then exiting/restarting Money, then changing this setting, then exiting/restarting Money, then turning MoneyExpre...

named ranges in other workbooks
i have a range of cells whose values are validated from a list determined by a name the name is determined by a formula which references a range of cells in a different workbook (i'm on a office network...) the problem is: if the other workbook is open (on my desktop?) the name is o.k. and the validation is fine... but: if the other workbook is not open, the name results in an error i didn't think that this is the way it's suppose to work... AURGHH Mark, Do you use a full reference such as ='C:\Documents and Settings\Owner\My Documents\Book1.xls'!profit Bernar...