Combo Box & Unhide Rows

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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.
 
Try changing each the combobox's Placement property e.g. try Placement
= 1

--

Joanna W said:
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:
 
apparently you haven't been following GJones' answers.

I suspect he posted in the right thread.
 
Back
Top