Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default visible label when yes is selected

Hi, I have in Col D, row 7 to 26 a choice of yes or no, based on the fact
that one of these cells is yes I want to show 2 labels, if non of the cells
is yes no the labels should not be seen, if the value within these cells is
changed from yes to no, and by doing so, none of the cells values is yes,
then the labels should not been seen.
The value of the cells can be changed via a listbox, and I have created a
module function pasted below. Who can help me fix this, because I do not
know, for your info I am a newby?

Function test_warn()
UserForm2.Label16.Visible = False
UserForm2.Label17.Visible = False
For rwIndex = 7 To 26
With Worksheets("XXXX").Cells(rwIndex, 4)
If .Value = "yes" Then
UserForm2.Label16.Visible = True
UserForm2.Label17.Visible = True
End If
End With
Next rwIndex
End Function

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default visible label when yes is selected

Try this Sub:


Sub test_warn()
yesek = WorksheetFunction.CountIf(Worksheets("XXXX").Range ("D7:D26"),
"yes") 0
UserForm1.Label1.Visible = yesek
UserForm1.Label2.Visible = yesek
End Sub

Regards,
Stefi

€˛noord453€¯ ezt Ć*rta:

Hi, I have in Col D, row 7 to 26 a choice of yes or no, based on the fact
that one of these cells is yes I want to show 2 labels, if non of the cells
is yes no the labels should not be seen, if the value within these cells is
changed from yes to no, and by doing so, none of the cells values is yes,
then the labels should not been seen.
The value of the cells can be changed via a listbox, and I have created a
module function pasted below. Who can help me fix this, because I do not
know, for your info I am a newby?

Function test_warn()
UserForm2.Label16.Visible = False
UserForm2.Label17.Visible = False
For rwIndex = 7 To 26
With Worksheets("XXXX").Cells(rwIndex, 4)
If .Value = "yes" Then
UserForm2.Label16.Visible = True
UserForm2.Label17.Visible = True
End If
End With
Next rwIndex
End Function

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default visible label when yes is selected

Of course change my test names to your real names:
UserForm2.Label16.Visible = yesek
UserForm2.Label17.Visible = yesek
Stefi


€˛Stefi€¯ ezt Ć*rta:

Try this Sub:


Sub test_warn()
yesek = WorksheetFunction.CountIf(Worksheets("XXXX").Range ("D7:D26"),
"yes") 0
UserForm1.Label1.Visible = yesek
UserForm1.Label2.Visible = yesek
End Sub

Regards,
Stefi

€˛noord453€¯ ezt Ć*rta:

Hi, I have in Col D, row 7 to 26 a choice of yes or no, based on the fact
that one of these cells is yes I want to show 2 labels, if non of the cells
is yes no the labels should not be seen, if the value within these cells is
changed from yes to no, and by doing so, none of the cells values is yes,
then the labels should not been seen.
The value of the cells can be changed via a listbox, and I have created a
module function pasted below. Who can help me fix this, because I do not
know, for your info I am a newby?

Function test_warn()
UserForm2.Label16.Visible = False
UserForm2.Label17.Visible = False
For rwIndex = 7 To 26
With Worksheets("XXXX").Cells(rwIndex, 4)
If .Value = "yes" Then
UserForm2.Label16.Visible = True
UserForm2.Label17.Visible = True
End If
End With
Next rwIndex
End Function

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default visible label when yes is selected

Stefi,

Thanks,

but it is not doing what it should be doing, when you select no first,
nothing happens as it should, when then yes is selected, it does not show,
which is not correct it must show, and then when no is selected again, the
labels remain visible.

I will try to explain again my orginal problem
In the cells D7:D26 the value of a choice is set, yes or no. This is done by
20 different listboxes. Each list box shows 2 labels when turned to yes, when
on of the 20 possible listboxes is yes, a second pair of labels above the
already shown labels should appear. If all is set no, these second pair
should not be visible.

Regards
Gerard



"Stefi" wrote:

Of course change my test names to your real names:
UserForm2.Label16.Visible = yesek
UserForm2.Label17.Visible = yesek
Stefi


€˛Stefi€¯ ezt Ć*rta:

Try this Sub:


Sub test_warn()
yesek = WorksheetFunction.CountIf(Worksheets("XXXX").Range ("D7:D26"),
"yes") 0
UserForm1.Label1.Visible = yesek
UserForm1.Label2.Visible = yesek
End Sub

Regards,
Stefi

€˛noord453€¯ ezt Ć*rta:

Hi, I have in Col D, row 7 to 26 a choice of yes or no, based on the fact
that one of these cells is yes I want to show 2 labels, if non of the cells
is yes no the labels should not be seen, if the value within these cells is
changed from yes to no, and by doing so, none of the cells values is yes,
then the labels should not been seen.
The value of the cells can be changed via a listbox, and I have created a
module function pasted below. Who can help me fix this, because I do not
know, for your info I am a newby?

Function test_warn()
UserForm2.Label16.Visible = False
UserForm2.Label17.Visible = False
For rwIndex = 7 To 26
With Worksheets("XXXX").Cells(rwIndex, 4)
If .Value = "yes" Then
UserForm2.Label16.Visible = True
UserForm2.Label17.Visible = True
End If
End With
Next rwIndex
End Function

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default visible label when yes is selected

I guess that you have to trigger the sub with a change event, but I leave for
today, I can come back to the problem on Monday.
Stefi


€˛noord453€¯ ezt Ć*rta:

Stefi,

Thanks,

but it is not doing what it should be doing, when you select no first,
nothing happens as it should, when then yes is selected, it does not show,
which is not correct it must show, and then when no is selected again, the
labels remain visible.

I will try to explain again my orginal problem
In the cells D7:D26 the value of a choice is set, yes or no. This is done by
20 different listboxes. Each list box shows 2 labels when turned to yes, when
on of the 20 possible listboxes is yes, a second pair of labels above the
already shown labels should appear. If all is set no, these second pair
should not be visible.

Regards
Gerard



"Stefi" wrote:

Of course change my test names to your real names:
UserForm2.Label16.Visible = yesek
UserForm2.Label17.Visible = yesek
Stefi


€˛Stefi€¯ ezt Ć*rta:

Try this Sub:


Sub test_warn()
yesek = WorksheetFunction.CountIf(Worksheets("XXXX").Range ("D7:D26"),
"yes") 0
UserForm1.Label1.Visible = yesek
UserForm1.Label2.Visible = yesek
End Sub

Regards,
Stefi

€˛noord453€¯ ezt Ć*rta:

Hi, I have in Col D, row 7 to 26 a choice of yes or no, based on the fact
that one of these cells is yes I want to show 2 labels, if non of the cells
is yes no the labels should not be seen, if the value within these cells is
changed from yes to no, and by doing so, none of the cells values is yes,
then the labels should not been seen.
The value of the cells can be changed via a listbox, and I have created a
module function pasted below. Who can help me fix this, because I do not
know, for your info I am a newby?

Function test_warn()
UserForm2.Label16.Visible = False
UserForm2.Label17.Visible = False
For rwIndex = 7 To 26
With Worksheets("XXXX").Cells(rwIndex, 4)
If .Value = "yes" Then
UserForm2.Label16.Visible = True
UserForm2.Label17.Visible = True
End If
End With
Next rwIndex
End Function

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
PivotTable with all row label visible carlos Excel Programming 0 January 26th 08 06:27 PM
Label on User Form visible Gimp Excel Programming 3 February 14th 07 07:35 PM
How do I type in a tab label and get that tab to be selected? hotdoxy Excel Discussion (Misc queries) 1 May 23rd 05 09:56 PM
Label Scroll Bar Properties: Make Visible? Mcasteel[_44_] Excel Programming 0 November 15th 04 02:52 PM
Getting the Label or Caption of MenuItem Selected Brian Stigler Excel Programming 1 January 22nd 04 04:48 PM


All times are GMT +1. The time now is 12:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"