Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to hide cols
I would like a macro that would allow me to hide col B to the selected col, minus one col(ie If I place the cursor on col F then col B thru E would be hidden or if the cursor is on COL J, the macro would hide Col B to I)
Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to hide cols
Hi,
Am Sun, 16 Sep 2012 11:40:22 -0700 (PDT) schrieb pcorcele: I would like a macro that would allow me to hide col B to the selected col, minus one col(ie If I place the cursor on col F then col B thru E would be hidden or if the cursor is on COL J, the macro would hide Col B to I) try: Sub HideCols() Dim myRow As Long Dim myAdr As String myRow = ActiveCell.Row myAdr = ActiveCell.Offset(0, -1).Address(0, 0) Range("B" & myRow & ":" & myAdr).EntireColumn.Hidden = True End Sub Regards Claus Busch -- Win XP PRof SP2 / Vista Ultimate SP2 Office 2003 SP2 /2007 Ultimate SP2 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to hide cols
On Sunday, 16 September 2012 14:40:22 UTC-4, pcorcele wrote:
I would like a macro that would allow me to hide col B to the selected col, minus one col(ie If I place the cursor on col F then col B thru E would be hidden or if the cursor is on COL J, the macro would hide Col B to I) Thanks That was just great ...and very quick. Thanks Ian M |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hide Cols ?? | Excel Programming | |||
Enhance sub to copy cols of variable length into 1 col to snake results into other cols | Excel Programming | |||
Range.Select 1st pass 13 cols, 2nd paqss 25 cols twice as wide in error? | Excel Programming | |||
Cond Format:re color 2 cols, skip 2 cols | Excel Worksheet Functions | |||
Hide Unused Cols & Rows in a Range | Excel Programming |