+ Reply to Thread
Results 1 to 2 of 2

Un hide non empty columns

  1. #1

    Un hide non empty columns

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

    Thanks


  2. #2
    Registered User
    Join Date
    03-16-2004
    Location
    Poland
    Posts
    2
    Quote Originally Posted by [email protected]
    Is there a macro to un-hide already hidden column which are not blank?

    Thanks
    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(StartAdr & ":" & EndAdr)) < 65536 Then
    Range(StartAdr & ":" & EndAdr).EntireColumn.AutoFit
    End If
    Next I
    Range("A1").Select
    End Sub
    Jozef

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1