hmltnangel
Active Member
- Joined
- Aug 25, 2010
- Messages
- 290
- Office Version
- 365
- Platform
- Windows
Hi All, wouold really appreciate some help on this one.
I use the code below to bring back some information from another worksheet. It works great. However Can I get the code an extra piece on the end, to hide specific columns if specific cells in that column are zero?
In Column F11:F60, every second cell is equals "Baseline", (so F11, F13 etc etc). What I want is for say, columns G:CA to hide if the total of the values in hose corresponding columns for Baseline is zero. So, if G11, G13,G15,G17 etc etc total zero, then hide column G.
Hope I am explaining this right, but happy to expand
I use the code below to bring back some information from another worksheet. It works great. However Can I get the code an extra piece on the end, to hide specific columns if specific cells in that column are zero?
VBA Code:
Sub ListMembers()
Dim Cl As Range
Dim Ary As Variant
Dim i As Long
On Error GoTo ErrMsg
With Sheets("Roster").ListObjects("Roster")
ReDim Ary(1 To .ListRows.Count, 1 To 1)
.Range.AutoFilter .ListColumns("Manager Emplid").Index, Sheets("Skills Matrix-rating template").Range("C4")
For Each Cl In .ListColumns("Emplid").DataBodyRange.SpecialCells(xlVisible)
i = i + 1
Ary(i, 1) = Cl.Value
i = i + 1
Next Cl
End With
Sheets("Skills Matrix-rating template").Range("B11").Resize(i).Value = Ary
ErrMsg:
MsgBox ("Not a Manager or Manager has no Direct Reports")
End Sub
In Column F11:F60, every second cell is equals "Baseline", (so F11, F13 etc etc). What I want is for say, columns G:CA to hide if the total of the values in hose corresponding columns for Baseline is zero. So, if G11, G13,G15,G17 etc etc total zero, then hide column G.
Hope I am explaining this right, but happy to expand