ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Listbox's, .Enabled and .Visible do not work (https://www.excelbanter.com/excel-programming/399591-listboxs-enabled-visible-do-not-work.html)

Rick S.

Listbox's, .Enabled and .Visible do not work
 
I do not see why this will not work.
'================
If CheckBox1 = True Then
ListBox1.Visible = False 'Use Visible or Enabled, neither work
'code here
end if
'=============
When this works fine
'=============
If CheckBox1 = True Then
CheckBox2.Visible = False
CheckBox3.Visible = False
End If
'=============

Thanks in advance!
--
Regards

Rick
XP Pro
Office 2007


JRForm

Listbox's, .Enabled and .Visible do not work
 
Rick S,

If on a form try Userform1.listbox1.visible=false
If on a worksheet then Sheets("sheet1").listbox1.visible=false

"Rick S." wrote:

I do not see why this will not work.
'================
If CheckBox1 = True Then
ListBox1.Visible = False 'Use Visible or Enabled, neither work
'code here
end if
'=============
When this works fine
'=============
If CheckBox1 = True Then
CheckBox2.Visible = False
CheckBox3.Visible = False
End If
'=============

Thanks in advance!
--
Regards

Rick
XP Pro
Office 2007


Rick S.

Listbox's, .Enabled and .Visible do not work
 
Yes it is on a Form and "Userform1.listbox1.visible=false" did not work either?

I can use the toolbox, set the visible value to False then load the form and
it is not visible. I just can't do it in a macro.

On the opposite side, I can not make the listbox visible if I turn it off
from the toolbox.

Crazy man! The whole world is crazy!

--
Regards

Rick
XP Pro
Office 2007



"JRForm" wrote:

Rick S,

If on a form try Userform1.listbox1.visible=false
If on a worksheet then Sheets("sheet1").listbox1.visible=false

"Rick S." wrote:

I do not see why this will not work.
'================
If CheckBox1 = True Then
ListBox1.Visible = False 'Use Visible or Enabled, neither work
'code here
end if
'=============
When this works fine
'=============
If CheckBox1 = True Then
CheckBox2.Visible = False
CheckBox3.Visible = False
End If
'=============

Thanks in advance!
--
Regards

Rick
XP Pro
Office 2007


Rick S.

Listbox's, .Enabled and .Visible do not work
 
Problem solved!
I simply had to pull my head from out of my behind!
The code was in the wrong part of the macro to know when the event occured.

Please keep the laughter to a dull roar, I still have work to do! ;)

--
Regards

Rick
XP Pro
Office 2007



"Rick S." wrote:

I do not see why this will not work.
'================
If CheckBox1 = True Then
ListBox1.Visible = False 'Use Visible or Enabled, neither work
'code here
end if
'=============
When this works fine
'=============
If CheckBox1 = True Then
CheckBox2.Visible = False
CheckBox3.Visible = False
End If
'=============

Thanks in advance!
--
Regards

Rick
XP Pro
Office 2007


JLGWhiz

Listbox's, .Enabled and .Visible do not work
 
Who's laughing, I've been there myself. I'm cheering for you.

"Rick S." wrote:

Problem solved!
I simply had to pull my head from out of my behind!
The code was in the wrong part of the macro to know when the event occured.

Please keep the laughter to a dull roar, I still have work to do! ;)

--
Regards

Rick
XP Pro
Office 2007



"Rick S." wrote:

I do not see why this will not work.
'================
If CheckBox1 = True Then
ListBox1.Visible = False 'Use Visible or Enabled, neither work
'code here
end if
'=============
When this works fine
'=============
If CheckBox1 = True Then
CheckBox2.Visible = False
CheckBox3.Visible = False
End If
'=============

Thanks in advance!
--
Regards

Rick
XP Pro
Office 2007



All times are GMT +1. The time now is 04:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com