ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to hide a column when value=1 (https://www.excelbanter.com/excel-programming/343764-how-hide-column-when-value%3D1.html)

angeloso

How to hide a column when value=1
 
Im tryng to do an interactive questionnaire, so that it would appear a
different list of questions depending on the previous answer. Therefore, Im
trying to show only the right questions for the previous answers, hidding the
rest of questions by hidding the column or the row in which they are placed.
So, what do I have to do?

Christian Galbavy

How to hide a column when value=1
 
Hy!

You can use the following code to hide columns:

If (value = 1) Then
Worksheets("Sheet1").Range("B:C").EntireColumn.Hid den = True
Else
Worksheets("Sheet1").Range("B:C").EntireColumn.Hid den = False
End If

Regards
Christian

"angeloso" schrieb im Newsbeitrag
...
Im tryng to do an interactive questionnaire, so that it would appear a
different list of questions depending on the previous answer. Therefore,
Im
trying to show only the right questions for the previous answers, hidding
the
rest of questions by hidding the column or the row in which they are
placed.
So, what do I have to do?




Tushar Mehta

How to hide a column when value=1
 
In article ,
says...
Im tryng to do an interactive questionnaire, so that it would appear a
different list of questions depending on the previous answer. Therefore, Im
trying to show only the right questions for the previous answers, hidding the
rest of questions by hidding the column or the row in which they are placed.
So, what do I have to do?

The only solution I can think of would use VBA code. That would mean
everyone taking the survey would have to enable macros. Personally, I
would not bother.

You may want to reorganize your approach to the issue. For starters,
XL may not be the best platform. Consider a web-based technique that
uses JavaScript with adapt the questionnaire based on already provided
answers. The results could be stored in a database based on a program
such as MS Access, My SQL, SQL Server, etc.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions


All times are GMT +1. The time now is 07:08 AM.

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