LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default change value on a form

Dear Bob and others,

This was a very usefull tip.

I would like to add a possibly usefull comment:
You can modify the:
For Each ctl In UserForm1.Controls
to
For Each ctl In UserForm1.Frame1.Controls
to make a selection of Controls on a Userform, i.e. those that are within
Frame1.

Regards,
Jan Bart


"Bob Phillips" wrote:

This method does not support the Exit event for textboxes. You need to go
into the calls module and see what events are supported.

This is the code that I used

Class Module


Public WithEvents TextBoxGroup As MSForms.TextBox

Private Sub TextBoxGroup_Change()
MsgBox "hello"
End Sub

Standard Module


Dim TextBoxes() As New Class1

Sub ShowDialog()
Dim TextBoxCount As Integer
Dim ctl As Control

' Create the Button objects
TextBoxCount = 0
For Each ctl In UserForm1.Controls
If TypeName(ctl) = "TextBox" Then
TextBoxCount = TextBoxCount + 1
ReDim Preserve TextBoxes(1 To TextBoxCount)
Set TextBoxes(TextBoxCount).TextBoxGroup = ctl
End If
Next ctl
UserForm1.Show
End Sub

--
HTH

Bob Phillips

"Liedson31" wrote in message
...
sorry Bob my previous doubt....i already did the adjustment that John talk
about
i forgot the part MsForms.TextBox.
Now i have all the textboxes grouped...
the question is....i try instead of command_click the
private Sub TextBoxGroup_Exit(ByVal Cancel As MSForms.ReturnBoolean)
--here i have the code
end sub

but it never enters here,can you help me?
thanks
Miguel



"Bob Phillips" wrote:

Private Sub TextBox1_Change()
myCommonMacro
End Sub


etc., or else youy can modify John Walkenbach's technique shown here
http://j-walk.com/ss/excel/tips/tip44.htm

--
HTH

Bob Phillips

"Liedson31" wrote in message
...
hi everyone.

i have a function that i want to run everytime the user change a value
from
all textboxes included on a form. i don´t want to put code on every
textbox,i´m asking if is that any way that once the user input a value

on
one
textbox i run a function.have the forms a change event or similar that

let
me
do this?

thanks in advance
Miguel









 
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
How do I protect a form so others can add to it but not change it? suflorida Excel Discussion (Misc queries) 1 August 13th 08 10:05 PM
DATE IN TEXT FORM - NEED TO CHANGE IT DATE FORM SSJ New Users to Excel 3 October 27th 06 08:34 PM
how can I make a form number change everytime the form is opened babydumplingspita Excel Worksheet Functions 1 October 10th 05 07:58 PM
Form Colors on a form change on a laptop pc akkrug New Users to Excel 2 September 15th 05 07:31 PM
Enable change only with Form? Ed Excel Programming 2 March 3rd 05 02:32 PM


All times are GMT +1. The time now is 11:21 AM.

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"