English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I'm trying to find a way in excel, either by condition, formula or VBA, ( VBA last option ) to hide a column if a cell does not contain any value, if a user enters a value into the cell, the column unhides.

Please if you knw the answer give me a non-VBA answer if you know, otherwise I'll settle for the VBA answer if there is none.

2007-02-04 22:38:03 · 3 answers · asked by per4more 3 in Computers & Internet Programming & Design

ok, so then how do do it in VBA

2007-02-04 23:42:03 · update #1

3 answers

I do not know a non VBA way to do this.
Here is one way
I used cell D14 and hide column G

Right click on your sheet tab and choose veiw code from the menu, then past this


Private Sub Worksheet_Change(ByVal Target As Range)

If [d14] = 0 Or [d14] = "" Then
Columns("G:G").EntireColumn. Hidden = True
Else: Columns("G:G").EntireColumn. Hidden = False
End If
End Sub

2007-02-05 04:35:59 · answer #1 · answered by Anonymous · 0 0

Your recommendations of utilising both a 2d sheet with the names and X's to both comprise or exclude them, or utilising checkboxes, will artwork. more convenient to do because that is swifter is the 2d sheet with corporation names and X's. extra stylish and extra perfect looking is the checkboxes, yet which will be tedious to make certain for one hundred+ names. that is, although, extremely person-friendly to do. The checkbox will be proper to a unique cellular which will change to authentic (if field is checked) or pretend (unchecked) and also you may base your exclusion or inclusion of a corporation in retaining with that authentic/pretend. enable's say you set up a checkbox and the proper cellular is C101, to attempt for authentic/pretend, only use this: =IF(C101, your_formula, "") If C101 = authentic, that is popular with the field is checked, and could execute the formulation. If that is fake, then it blanks out the cellular, and also you may sum or trouble-free in common words the cells with numbers showing.

2016-11-25 03:19:44 · answer #2 · answered by Anonymous · 0 0

u should done it in vba

2007-02-04 23:24:55 · answer #3 · answered by deval_agrifarman 6 · 0 2

fedest.com, questions and answers