Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Un hide non empty columns

Is there a macro to un-hide already hidden column which are not blank?

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Un hide non empty columns


Try this:

Sub UnhideCol()
Dim I As Integer, StartAdr As Variant, EndAdr As Variant
StartAdr = Range("A1").Address
EndAdr = Range("A65536").Address
For I = 0 To 255
StartAdr = Range("A1").Offset(0, I).Address
EndAdr = Range("A65536").Offset(0, I).Address
If Application.WorksheetFunction.CountBlank(Range(Sta rtAdr & ":" &
EndAdr)) < 65536 Then
Range(StartAdr & ":" & EndAdr).EntireColumn.AutoFit
End If
Next I
Range("A1").Select
End Sub

Jozef


--
Joseph_L
------------------------------------------------------------------------
Joseph_L's Profile: http://www.excelforum.com/member.php...fo&userid=7202
View this thread: http://www.excelforum.com/showthread...hreadid=519428

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
How do I automatically hide empty columns in Excel? Ned Mains Excel Discussion (Misc queries) 3 April 29th 23 07:44 PM
Want to Hide columns in spreadsheet but NOT hide data in chart. KrispyData Charts and Charting in Excel 1 March 20th 09 04:45 PM
Finding next empty empty cell in a range of columns UncleBun Excel Programming 1 January 13th 06 11:22 PM
URGENT!! Use macro button to hide empty columns and rows...HELP!!!! Hawk Excel Programming 8 July 8th 05 10:38 PM
How to auto hide an empty row with VBA? Applewine Excel Programming 1 January 30th 04 08:21 AM


All times are GMT +1. The time now is 01:45 AM.

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

About Us

"It's about Microsoft Excel"