ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Combo Box & Unhide Rows (https://www.excelbanter.com/excel-programming/283033-combo-box-unhide-rows.html)

Joanna W

Combo Box & Unhide Rows
 

I have a survey template created by another that I am modifying for my use. The template includes dropdown boxes for secondary questions based on responses to primary questions. The code instructs Excel to hide rows & set visible properties of the dropdown boxes in those rows to false. If the user goes back and answers a question with a secondary response, the rows reappear as programmed, but the combo boxes will stack up below the original selection. Here is a sample of the code used:

If Sheets("parameters").Range("acty_d1_value").Value = 0 Then
'hide drop down boxes
ActiveSheet.cbx_a1d1.Visible = False
ActiveSheet.cbx_a1d2.Visible = False
ActiveSheet.cbx_a1d3.Visible = False
'Black out the activity name and total
ActiveSheet.Range("get_info_detl_a1").Select
Selection.RowHeight = 0
ActiveSheet.Range("a1").Select


Else
'unhide drop down boxes
ActiveSheet.cbx_a1d1.Visible = True
ActiveSheet.cbx_a1d2.Visible = True
ActiveSheet.cbx_a1d3.Visible = True
'make rowheight 45
ActiveSheet.Range("get_info_detl_a1").Select
Selection.RowHeight = 25
ActiveSheet.Range("a1").Select


get_info_detl_a1 refers to teh entire range of the questions & dropdowns for the A1 series; the cbx references are the names I gave the combo boxes.

Any suggestions?

GJones

Combo Box & Unhide Rows
 
Video Refresh Rate and Video Memory capacity. I think!
-----Original Message-----

I have a survey template created by another that I am

modifying for my use. The template includes dropdown
boxes for secondary questions based on responses to
primary questions. The code instructs Excel to hide rows
& set visible properties of the dropdown boxes in those
rows to false. If the user goes back and answers a
question with a secondary response, the rows reappear as
programmed, but the combo boxes will stack up below the
original selection. Here is a sample of the code used:

If Sheets("parameters").Range("acty_d1_value").Value = 0

Then
'hide drop down boxes
ActiveSheet.cbx_a1d1.Visible = False
ActiveSheet.cbx_a1d2.Visible = False
ActiveSheet.cbx_a1d3.Visible = False
'Black out the activity name and total
ActiveSheet.Range("get_info_detl_a1").Select
Selection.RowHeight = 0
ActiveSheet.Range("a1").Select


Else
'unhide drop down boxes
ActiveSheet.cbx_a1d1.Visible = True
ActiveSheet.cbx_a1d2.Visible = True
ActiveSheet.cbx_a1d3.Visible = True
'make rowheight 45
ActiveSheet.Range("get_info_detl_a1").Select
Selection.RowHeight = 25
ActiveSheet.Range("a1").Select


get_info_detl_a1 refers to teh entire range of the

questions & dropdowns for the A1 series; the cbx
references are the names I gave the combo boxes.

Any suggestions?
.


onedaywhen

Combo Box & Unhide Rows
 
Try changing each the combobox's Placement property e.g. try Placement
= 1

--

"Joanna W" wrote in message ...
I have a survey template created by another that I am modifying for

my use. The template includes dropdown boxes for secondary questions
based on responses to primary questions. The code instructs Excel to
hide rows & set visible properties of the dropdown boxes in those rows
to false. If the user goes back and answers a question with a
secondary response, the rows reappear as programmed, but the combo
boxes will stack up below the original selection. Here is a sample of
the code used:

If Sheets("parameters").Range("acty_d1_value").Value = 0 Then
'hide drop down boxes
ActiveSheet.cbx_a1d1.Visible = False
ActiveSheet.cbx_a1d2.Visible = False
ActiveSheet.cbx_a1d3.Visible = False
'Black out the activity name and total
ActiveSheet.Range("get_info_detl_a1").Select
Selection.RowHeight = 0
ActiveSheet.Range("a1").Select


Else
'unhide drop down boxes
ActiveSheet.cbx_a1d1.Visible = True
ActiveSheet.cbx_a1d2.Visible = True
ActiveSheet.cbx_a1d3.Visible = True
'make rowheight 45
ActiveSheet.Range("get_info_detl_a1").Select
Selection.RowHeight = 25
ActiveSheet.Range("a1").Select


get_info_detl_a1 refers to teh entire range of the questions & dropdowns for the A1 series; the cbx references are the names I gave the combo boxes.

Any suggestions?


onedaywhen

Combo Box & Unhide Rows
 
GJones, I think you posted to the wrong thread!
--

"GJones" wrote in message ...
Video Refresh Rate and Video Memory capacity. I think!
-----Original Message-----

I have a survey template created by another that I am

modifying for my use. The template includes dropdown
boxes for secondary questions based on responses to
primary questions. The code instructs Excel to hide rows
& set visible properties of the dropdown boxes in those
rows to false. If the user goes back and answers a
question with a secondary response, the rows reappear as
programmed, but the combo boxes will stack up below the
original selection. Here is a sample of the code used:

If Sheets("parameters").Range("acty_d1_value").Value = 0

Then
'hide drop down boxes
ActiveSheet.cbx_a1d1.Visible = False
ActiveSheet.cbx_a1d2.Visible = False
ActiveSheet.cbx_a1d3.Visible = False
'Black out the activity name and total
ActiveSheet.Range("get_info_detl_a1").Select
Selection.RowHeight = 0
ActiveSheet.Range("a1").Select


Else
'unhide drop down boxes
ActiveSheet.cbx_a1d1.Visible = True
ActiveSheet.cbx_a1d2.Visible = True
ActiveSheet.cbx_a1d3.Visible = True
'make rowheight 45
ActiveSheet.Range("get_info_detl_a1").Select
Selection.RowHeight = 25
ActiveSheet.Range("a1").Select


get_info_detl_a1 refers to teh entire range of the

questions & dropdowns for the A1 series; the cbx
references are the names I gave the combo boxes.

Any suggestions?
.


Tom Ogilvy

Combo Box & Unhide Rows
 
apparently you haven't been following GJones' answers.

I suspect he posted in the right thread.

--
Regards,
Tom Ogilvy


"onedaywhen" wrote in message
om...
GJones, I think you posted to the wrong thread!
--

"GJones" wrote in message

...
Video Refresh Rate and Video Memory capacity. I think!
-----Original Message-----

I have a survey template created by another that I am

modifying for my use. The template includes dropdown
boxes for secondary questions based on responses to
primary questions. The code instructs Excel to hide rows
& set visible properties of the dropdown boxes in those
rows to false. If the user goes back and answers a
question with a secondary response, the rows reappear as
programmed, but the combo boxes will stack up below the
original selection. Here is a sample of the code used:

If Sheets("parameters").Range("acty_d1_value").Value = 0

Then
'hide drop down boxes
ActiveSheet.cbx_a1d1.Visible = False
ActiveSheet.cbx_a1d2.Visible = False
ActiveSheet.cbx_a1d3.Visible = False
'Black out the activity name and total
ActiveSheet.Range("get_info_detl_a1").Select
Selection.RowHeight = 0
ActiveSheet.Range("a1").Select


Else
'unhide drop down boxes
ActiveSheet.cbx_a1d1.Visible = True
ActiveSheet.cbx_a1d2.Visible = True
ActiveSheet.cbx_a1d3.Visible = True
'make rowheight 45
ActiveSheet.Range("get_info_detl_a1").Select
Selection.RowHeight = 25
ActiveSheet.Range("a1").Select


get_info_detl_a1 refers to teh entire range of the

questions & dropdowns for the A1 series; the cbx
references are the names I gave the combo boxes.

Any suggestions?
.




onedaywhen

Combo Box & Unhide Rows
 
Apologies if I got that wrong.

--

"Tom Ogilvy" wrote in message ...
apparently you haven't been following GJones' answers.

I suspect he posted in the right thread.

--
Regards,
Tom Ogilvy


"onedaywhen" wrote in message
om...
GJones, I think you posted to the wrong thread!
--

"GJones" wrote in message

...
Video Refresh Rate and Video Memory capacity. I think!
-----Original Message-----

I have a survey template created by another that I am
modifying for my use. The template includes dropdown
boxes for secondary questions based on responses to
primary questions. The code instructs Excel to hide rows
& set visible properties of the dropdown boxes in those
rows to false. If the user goes back and answers a
question with a secondary response, the rows reappear as
programmed, but the combo boxes will stack up below the
original selection. Here is a sample of the code used:

If Sheets("parameters").Range("acty_d1_value").Value = 0

Then
'hide drop down boxes
ActiveSheet.cbx_a1d1.Visible = False
ActiveSheet.cbx_a1d2.Visible = False
ActiveSheet.cbx_a1d3.Visible = False
'Black out the activity name and total
ActiveSheet.Range("get_info_detl_a1").Select
Selection.RowHeight = 0
ActiveSheet.Range("a1").Select


Else
'unhide drop down boxes
ActiveSheet.cbx_a1d1.Visible = True
ActiveSheet.cbx_a1d2.Visible = True
ActiveSheet.cbx_a1d3.Visible = True
'make rowheight 45
ActiveSheet.Range("get_info_detl_a1").Select
Selection.RowHeight = 25
ActiveSheet.Range("a1").Select


get_info_detl_a1 refers to teh entire range of the
questions & dropdowns for the A1 series; the cbx
references are the names I gave the combo boxes.

Any suggestions?
.



All times are GMT +1. The time now is 12:39 AM.

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