Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Auto Hide-Unhide Columns with a macro

Give this a whirl...

Sub HideUnhideColumns()
Dim rngToHide As Range

On Error Resume Next
Set rngToHide = ActiveCell.EntireRow.SpecialCells(xlCellTypeBlanks )
On Error GoTo 0

If Not rngToHide Is Nothing Then
ActiveSheet.Cells.EntireColumn.Hidden = False
rngToHide.EntireColumn.Hidden = True
End If
End Sub

--
HTH...

Jim Thomlinson


"Ed" wrote:

Hello,
I have a table from A1:EG70 that looks like a checkerboard, not all cells
have info in them. Does anyone know a macro to auto hide the empty columns
within the active row? The idea is to have visible only the columns with info
while browsing vertically the different entries.

thanks!

  #2   Report Post  
Posted to microsoft.public.excel.misc
Ed Ed is offline
external usenet poster
 
Posts: 279
Default Auto Hide-Unhide Columns with a macro

Jim, I couldn't make it to work, I don't know if I needed anything special to
make it work. I put it into "ThisWorkbook" inside VBA and into a Module and
so on but I can't get it to work. Do you have any idea why that could be?


Reply
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
Auto hide/Unhide columns Vespaguy Excel Worksheet Functions 5 August 25th 07 01:08 AM
Hide/Unhide columns using button on top over relevant columns [email protected] Excel Discussion (Misc queries) 1 March 7th 07 09:24 PM
Using Hide, Unhide, and auto filter - select all on a protected sh Pattie Excel Worksheet Functions 1 July 7th 06 04:47 PM
How to auto hide and unhide columns using 1 and 2 icons R. Rebello Excel Worksheet Functions 1 May 12th 06 08:10 AM
How do I hide or unhide zero value columns/rows USING A MACRO? paul Excel Discussion (Misc queries) 1 January 23rd 06 03:06 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"