E
Excel User
Hi,
I'm trying to set a range that is hidden from an array, but cannot seem to
get it working, also is there a better way to set the range as you can see
from below after rng1 is set, rng2 is one column right from each column in
rng1, rng3 is one column right from each column in rng2 etc
private function hidecols(who)
Dim RngToHide As Range
RngToHide = who
rng1= "BW:BW,CC:CC,CI:CI,CO:CO,CU:CU,DAA,DGG,DMM,DSS,DYY"
rng2 =
"BX:BX,CD:CD,CJ:CJ,CP:CP,CV:CV,DBB,DHH,DNN,DTT,DZZ,EF:EF"
rng3 =
"BY:BY,CE:CE,CK:CK,CQ:CQ,CW:CW,DCC,DII,DOO,DUU,DAA,EG:EG"
rng4 =
"BZ:BZ,CF:CF,CL:CL,CR:CR,CX:CX,DDD,DJJ,DPP,DVV,DBB,EH:EH,EN:EN"
rng5 =
"BA:BA,CG:CG,CM:CM,CS:CS,CY:CV,DEE,DKK,DQQ,DWW,DCC,EI:EI,EO:EO"
Range(RngToHide).Select
Selection.EntireColumn.Hidden = True
End Sub
I'm trying to set a range that is hidden from an array, but cannot seem to
get it working, also is there a better way to set the range as you can see
from below after rng1 is set, rng2 is one column right from each column in
rng1, rng3 is one column right from each column in rng2 etc
private function hidecols(who)
Dim RngToHide As Range
RngToHide = who
rng1= "BW:BW,CC:CC,CI:CI,CO:CO,CU:CU,DAA,DGG,DMM,DSS,DYY"
rng2 =
"BX:BX,CD:CD,CJ:CJ,CP:CP,CV:CV,DBB,DHH,DNN,DTT,DZZ,EF:EF"
rng3 =
"BY:BY,CE:CE,CK:CK,CQ:CQ,CW:CW,DCC,DII,DOO,DUU,DAA,EG:EG"
rng4 =
"BZ:BZ,CF:CF,CL:CL,CR:CR,CX:CX,DDD,DJJ,DPP,DVV,DBB,EH:EH,EN:EN"
rng5 =
"BA:BA,CG:CG,CM:CM,CS:CS,CY:CV,DEE,DKK,DQQ,DWW,DCC,EI:EI,EO:EO"
Range(RngToHide).Select
Selection.EntireColumn.Hidden = True
End Sub