Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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/mic... 993ded867dd4 Thanks a lot in advance Regards' Joe |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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/sh...d.php?t=204280 http://www.thecodecage.com/forumz |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
But I need it in runtime !
|
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On May 21, 4:28*pm, Joe 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/mic....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... |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Your description is somewhat confusing... can you give more detail about
what you are actually trying to do? -- Rick (MVP - Excel) "Joe" wrote in message ... 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/mic... 993ded867dd4 Thanks a lot in advance Regards' Joe |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 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/mic... 993ded867dd4 Thanks a lot in advance Regards' Joe |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Selecting control on userform with part of control name (set question) | Excel Programming | |||
Dim Userform Control | Excel Programming | |||
Control Sequence from Userform Control | Excel Programming | |||
Userform control | Excel Programming | |||
UserForm Control | Excel Programming |