LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Select range from a varaible

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,DA:DA,DG:DG,DM:DM,D S:DS,DY:DY"
rng2 =
"BX:BX,CD:CD,CJ:CJ,CP:CP,CV:CV,DB:DB,DH:DH,DN:DN,D T:DT,DZ:DZ,EF:EF"
rng3 =
"BY:BY,CE:CE,CK:CK,CQ:CQ,CW:CW,DC:DC,DI:DI,DO:DO,D U:DU,DA:DA,EG:EG"
rng4 =
"BZ:BZ,CF:CF,CL:CL,CR:CR,CX:CX,DD:DD,DJ:DJ,DP:DP,D V:DV,DB:DB,EH:EH,EN:EN"
rng5 =
"BA:BA,CG:CG,CM:CM,CS:CS,CY:CV,DE:DE,DK:DK,DQ:DQ,D W:DW,DC:DC,EI:EI,EO:EO"


Range(RngToHide).Select
Selection.EntireColumn.Hidden = True
End Sub

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hyperlink varaible substitution - How To Sledge Bacon Excel Worksheet Functions 10 May 29th 08 06:03 PM
How do I macro sort with a varaible range (differing last cell)? sutibusan Excel Programming 2 November 7th 07 08:24 PM
Object varaible or With block variable not set? Rick S. Excel Programming 4 September 26th 07 07:20 PM
assining a varaible to the value in another sheet. shishi Excel Programming 1 August 8th 05 09:40 PM
Use varaible for worsheet name in a formule slm Excel Programming 3 July 19th 05 12:34 PM


All times are GMT +1. The time now is 05:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"