Hi,
I need help to unhide 4 columns of a month if I select "Variance" from the dropdown list. At present 3 columns are unhide but I need the % column to unhide.
Regards,
Barieq
Hi,
I need help to unhide 4 columns of a month if I select "Variance" from the dropdown list. At present 3 columns are unhide but I need the % column to unhide.
Regards,
Barieq
Last edited by Barieq; 10-24-2016 at 09:16 AM.
Hi,
Is it only Variance that should result in all columns being unhidden? The other options should still only unhide their specific columns?
Don
Please remember to mark your thread 'Solved' when appropriate.
Hi,
Thanks, I am ok with other options. Only I need the following columns from 12 Periods to be unhide if I select "Variance"
Budget
Actual
Variance
%
Regards,
Is it acceptable for the code to simply unhide all columns for Variance, or does your real data contain other columns that should remain hidden?
If all columns may be unhidden, you may simply test for that case
![]()
Private Const colFirst As Long = 2 Private Const nPeriods As Long = 12 Private Const colCountGroup As Long = 4 Private Const colCount As Long = colCountGroup * nPeriods + colCountGroup Private Enum modeView modeViewPlan = 1 modeViewActual = 2 modeViewDiff = 3 modeViewPercent = 4 End Enum Private Property Get CurrentView() As modeView CurrentView = Application.ThisWorkbook.Names("currentView").RefersToRange.Value End Property Private Sub cmbView_Click() Dim nIdx As Long Dim nCalcMode As Excel.XlCalculation nCalcMode = Application.Calculation Application.Calculation = xlCalculationManual If CurrentView = modeViewDiff Then ActiveSheet.Cells.EntireColumn.Hidden = False Else For nIdx = 1 To colCount ActiveSheet.Columns(colFirst + nIdx - 1).Hidden = _ Not ((CLng(CurrentView) Or (((nIdx - 1) Mod colCountGroup) + 1)) = CLng(CurrentView)) Next End If Application.Calculation = nCalcMode End Sub
Thanks, No there is no other columns to be hidden. I am ok with your code. It is Solved.
How can delete my same post which by mistake has been posted twice.
I imagine the simplest way is to click the Report Post button below your other post and bring it to the moderators' attention as a duplicated posting.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks