Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 699
Default HELP: how to locate objects on userform from VBA code

Hi All,

How do I locate objects on userform based on the VBA code?

For eg: I have some events like StudentYes_Click and StudentNo_Click in the
VBAProject and there is some code in those events. I tried Debug -- Compile
but didnt get any compile errors. So I am assuming I have those two radio
buttons somewhere on the userform, But I am not able to find them.

Is there a way to resolve this? how do I find those two radio buttons?

Thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default HELP: how to locate objects on userform from VBA code

In the Visual Basic Editor (VBE), open the form.
Select F4 to view the Propeties Window.
Left-click anywhere within the form.
The Properties Window will show the name of the object you clicked on in the
form.
Now, open the Dropdown in the Properties Window next to the name of the
object you clicked on. Search for 'Student_Yes' and 'StudentNO'. Click on
one of them. It will be highlighted on the form.
--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"sam" wrote:

Hi All,

How do I locate objects on userform based on the VBA code?

For eg: I have some events like StudentYes_Click and StudentNo_Click in the
VBAProject and there is some code in those events. I tried Debug -- Compile
but didnt get any compile errors. So I am assuming I have those two radio
buttons somewhere on the userform, But I am not able to find them.

Is there a way to resolve this? how do I find those two radio buttons?

Thanks in advance

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default HELP: how to locate objects on userform from VBA code

sam,
see if this helps.

code goes behind your form

Dim ctl As Control

For Each ctl In Me.Controls

ctl.Visible = True

MsgBox ctl.Name

Next
--
jb


"sam" wrote:

Hi All,

How do I locate objects on userform based on the VBA code?

For eg: I have some events like StudentYes_Click and StudentNo_Click in the
VBAProject and there is some code in those events. I tried Debug -- Compile
but didnt get any compile errors. So I am assuming I have those two radio
buttons somewhere on the userform, But I am not able to find them.

Is there a way to resolve this? how do I find those two radio buttons?

Thanks in advance

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
Userform Objects Kaval Excel Programming 2 August 22nd 08 10:38 AM
VB Code Help - locate and sum Stan Excel Discussion (Misc queries) 4 April 25th 07 05:33 PM
Code can't locate filename davidm Excel Programming 2 July 18th 05 12:29 PM
Apply vba code to multiple userform objects sjoopie[_2_] Excel Programming 2 November 5th 04 01:42 PM
Apply vba code to multiple userform objects sjoopie Excel Programming 2 November 5th 04 12:15 PM


All times are GMT +1. The time now is 10:57 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"