Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Urgent help needed - Change in userform...
i have a userform. In that userform there are some optionbuttons an checkboxes. And i have a textbox in which i see the results accordin to above mentioned buttons. I want this textbox updated whenever there is a change in optionbutton or checkboxes (I dont want to press the OK button to make th calculations) For example if there is such a sub like "Private Su Userform1_Change()" , i can use it. But i could not find such a sub Please help Thanks in advanc -- barkin ----------------------------------------------------------------------- barkiny's Profile: http://www.excelforum.com/member.php...fo&userid=2039 View this thread: http://www.excelforum.com/showthread.php?threadid=56638 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Urgent help needed - Change in userform...
Private Sub CheckBox1_Change() TextBox1.Text = "Barkiny" End Su -- raypayett ----------------------------------------------------------------------- raypayette's Profile: http://www.excelforum.com/member.php...fo&userid=2956 View this thread: http://www.excelforum.com/showthread.php?threadid=56638 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Urgent help needed - Change in userform...
The boxes have Change and Clik events, call your code from those.
HTH. Best wishes Harald "barkiny" skrev i melding ... i have a userform. In that userform there are some optionbuttons and checkboxes. And i have a textbox in which i see the results according to above mentioned buttons. I want this textbox updated whenever there is a change in optionbuttons or checkboxes (I dont want to press the OK button to make the calculations) For example if there is such a sub like "Private Sub Userform1_Change()" , i can use it. But i could not find such a sub Please help Thanks in advance -- barkiny ------------------------------------------------------------------------ barkiny's Profile: http://www.excelforum.com/member.php...o&userid=20397 View this thread: http://www.excelforum.com/showthread...hreadid=566387 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Urgent help needed - Change in userform...
thanks for your reply But i have too many checkboxes and optionbuttons.I dont want to writ for each of them like Private Sub CheckBox1_Change() Private Sub CheckBox2_Change() Private Sub CheckBox3_Change() |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Urgent help needed - Change in userform...
I'm afraid you will have to have code for each control. Programming is very precise. If you think that is a lot of code, you should see programs in other languages! -- raypayette ------------------------------------------------------------------------ raypayette's Profile: http://www.excelforum.com/member.php...o&userid=29569 View this thread: http://www.excelforum.com/showthread...hreadid=566387 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Urgent help needed - Change in userform...
thanks for your reply herald As i said there are too many boxes, I dont want to call one by on -- barkiny ------------------------------------------------------------------------ barkiny's Profile: http://www.excelforum.com/member.php...o&userid=20397 View this thread: http://www.excelforum.com/showthread...hreadid=566387 |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Urgent help needed - Change in userform...
Hi barkiny,
Search this ng for "WithEvents Checkbox", here's one pasted below - " start copied post Insert a class module named "Class1" and two command buttons near the bottom of a userform. '' start code in Class1 Public WithEvents cbx As MSForms.CheckBox Private Sub cbx_Change() MsgBox cbx.Tag & " : " & cbx.Value, , cbx.Name 'do stuff End Sub '' end code in Class1 ''Start code in Userform1 Dim colClsChBoxes As New Collection Private Sub CommandButton1_Click() Dim cls As Class1 Dim cb As Control For i = 1 To 3 Set cb = Me.Controls.Add("Forms.CheckBox.1", "My Check Box " & i, True) With cb ..Left = 10 ..Top = (i - 1) * 30 + 5 ..Width = 90 ..Height = 30 ..Caption = .Name End With Set cls = New Class1 Set cls.cbx = cb colClsChBoxes.Add cls cb.Tag = colClsChBoxes.Count Next End Sub Private Sub CommandButton2_Click() Dim cnt As Long Dim arr() As Boolean cnt = colClsChBoxes.Count If cnt Then ReDim arr(1 To cnt) For i = 1 To cnt arr(i) = colClsChBoxes(i).cbx.Value MsgBox arr(i), , colClsChBoxes(i).cbx.Name Next Else MsgBox "No checkboxes in collection" End If End Sub '' end code in Userform1 Class's for existing checkboxes could have course been instanciated and added to the collection in the Intitialize event. If you want to refer to the collection of class's (and hence checkboxes) elsewhere in your project, declare colClsChBoxes as Public in a normal module. " end copied post Now add a wide textbox named TexBox1, comment the msgbox line and replace with Dim s As String s = cbx.Name & " Tag: " & cbx.Tag & " checked: " & cbx.Value cbx.Parent.TextBox1.Text = s Regards, Peter T "barkiny" wrote in message ... thanks for your reply herald As i said there are too many boxes, I dont want to call one by one -- barkiny ------------------------------------------------------------------------ barkiny's Profile: http://www.excelforum.com/member.php...o&userid=20397 View this thread: http://www.excelforum.com/showthread...hreadid=566387 |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Urgent help needed - Change in userform...
It's not a question of what you want, it's a question of what needs to be
done to make it work. If you don't want to do it, hire someone to do it for you, you're probably sufficiently exhausted after typing these replies, even though you saved a little energy skipping the Shift key here and there. Best wishes Harald "barkiny" skrev i melding ... thanks for your reply herald As i said there are too many boxes, I dont want to call one by one -- barkiny ------------------------------------------------------------------------ barkiny's Profile: http://www.excelforum.com/member.php...o&userid=20397 View this thread: http://www.excelforum.com/showthread...hreadid=566387 |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
Urgent help needed - Change in userform...
you're [OP] probably sufficiently exhausted after typing these replies,
even though you saved a little energy skipping the Shift key here and there. The OP did say this was urgent, so he may not have had time to use the Shift key ! Regards, Peter T "Harald Staff" wrote in message ... It's not a question of what you want, it's a question of what needs to be done to make it work. If you don't want to do it, hire someone to do it for you, you're probably sufficiently exhausted after typing these replies, even though you saved a little energy skipping the Shift key here and there. Best wishes Harald "barkiny" skrev i melding ... thanks for your reply herald As i said there are too many boxes, I dont want to call one by one -- barkiny ------------------------------------------------------------------------ barkiny's Profile: http://www.excelforum.com/member.php...o&userid=20397 View this thread: http://www.excelforum.com/showthread...hreadid=566387 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Urgent help needed please | Excel Discussion (Misc queries) | |||
URGENT HELP NEEDED | Excel Discussion (Misc queries) | |||
urgent help needed please anyone | Excel Programming | |||
Urgent Help needed | Excel Discussion (Misc queries) | |||
Urgent help needed! | Excel Worksheet Functions |