+ Reply to Thread
Results 1 to 6 of 6

Unable to set columns hidden

Hybrid View

dentler Unable to set columns hidden 03-16-2025, 04:25 PM
alansidman Re: Unable to set columns... 03-16-2025, 04:49 PM
dentler Re: Unable to set columns... 03-17-2025, 12:11 PM
ByteMarks Re: Unable to set columns... 03-18-2025, 06:47 AM
MSDols Re: Unable to set columns... 04-08-2025, 03:45 AM
dentler Re: Unable to set columns... 04-09-2025, 10:23 AM
  1. #1
    Forum Contributor
    Join Date
    01-08-2017
    Location
    Salt Lake City, Ut.
    MS-Off Ver
    2019 and 365
    Posts
    141

    Question Unable to set columns hidden

    I am not sure that this is the right place although my spreadsheet is run with VBA, but I have a spreadsheet that I routinely have columns P through XFD hidden since they are outside scope of my worksheet. For some reason, I found that I can no longer set the entire range hidden. After troubleshooting, I found I could hide columns P through T and columns AA through XFD. Columns U,V,W,X,Y,Z will not allow me to hide them. I have selected them at the top of the columns and pressed the Delete key, but still unable to hide them. Changed the format on those columns to General, selected again and pressed the Delete key, but still unable to hide them.

    Does anyone have any idea what may be happening, or a routine that can run from top to bottom of these columns to ensure everything is cleared?

    Any help or suggestions would be greatly appreciated.

    Thank you

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2506 Win 11
    Posts
    24,762

    Re: Unable to set columns hidden

    You might want to try using this VBA. First unhide all the columns, then apply this VBA to a command button.

    Private Sub HideUnhide_Click()
    If Range("List your range here").EntireColumn.Hidden = True Then
    Range("List your range here").EntireColumn.Hidden = False
    Else: Range("List your range here").EntireColumn.Hidden = True
    End If
    End Sub
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    01-08-2017
    Location
    Salt Lake City, Ut.
    MS-Off Ver
    2019 and 365
    Posts
    141

    Re: Unable to set columns hidden

    Thank you but I tried this, and it does not work. I have found that I can manually select columns and then right click to get the column menu and then select high and it works. However, if I try to select all columns to the end I get the following error: "Can't push objects off the sheet"?

  4. #4
    Forum Expert ByteMarks's Avatar
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    3,093

    Re: Unable to set columns hidden

    Are you able to post the workbook?

  5. #5
    Forum Contributor
    Join Date
    01-25-2025
    Location
    Presov, Slovakia
    MS-Off Ver
    2021
    Posts
    196

    Re: Unable to set columns hidden

    Hi dentler,
    first of all make a copy of the file.
    I am attaching a macro that will search for objects. Both hidden and miniature ...
    If it finds something, it will prompt you to confirm the deletion of the object.
    Sub show_all()
      Dim a, b, c, d, left_obj, left_col, top_obj, top_row
      a = 1
      While a > Empty
        b = 0
        On Error GoTo ch1
        ActiveSheet.Shapes(a).Visible = True
        On Error GoTo 0
        If b = 0 Then
          left_obj = ActiveSheet.Shapes(a).Left
          left_col = 0
          c = 1
          While left_col < left_obj
            left_col = Columns(c).Left
            c = c + 1
          Wend
          top_obj = ActiveSheet.Shapes(a).Top
          top_row = 0
          d = 1
          While top_row < top_obj
            top_row = Rows(d).Top
            d = d + 1
          Wend
          On Error GoTo ch2
          If ActiveSheet.Shapes(a).Height < 5 Then
            ActiveSheet.Shapes(a).Top = ActiveSheet.Shapes(a).Top - 20 + ActiveSheet.Shapes(a).Height
            ActiveSheet.Shapes(a).Height = 20
          End If
          If ActiveSheet.Shapes(a).Width < 5 Then
            ActiveSheet.Shapes(a).Left = ActiveSheet.Shapes(a).Left - 20 + ActiveSheet.Shapes(a).Width
            ActiveSheet.Shapes(a).Width = 20
          End If
          Cells(d + 2, c - 2).Select
          Cells(d - 2, c - 2).Select
          Cells(d - 1, c - 2).Select
          Cells(d - 1, c - 2).Interior.Color = 65535
          On Error GoTo 0
          challenge = "Delete object?    " & ActiveSheet.Shapes(a).Name
          challenge = MsgBox(challenge, 4096 + 4, "Object search")
          If challenge = 6 Then
            ActiveSheet.Shapes(a).Delete
            a = a - 1
          End If
          Cells(d - 1, c - 2).Interior.Pattern = xlNone
        Else
          MsgBox "end"
          Exit Sub
        End If
        a = a + 1
      Wend
      Exit Sub
    ch1:
      b = 1
      Resume Next
    ch2:
      Resume Next
    End Sub
    m.s.

  6. #6
    Forum Contributor
    Join Date
    01-08-2017
    Location
    Salt Lake City, Ut.
    MS-Off Ver
    2019 and 365
    Posts
    141

    Re: Unable to set columns hidden

    Thank You. I will give it a try.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Unable to set the Hidden property of the Range class
    By MP1286 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-07-2017, 06:32 AM
  2. Replies: 0
    Last Post: 01-15-2014, 05:17 PM
  3. Replies: 0
    Last Post: 09-13-2012, 11:10 AM
  4. [SOLVED] Hide columns based on cell value - Unable to set hidden range property of Range Class
    By trillium in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-13-2012, 11:13 PM
  5. [SOLVED] Unable to unhide some hidden rows
    By rro in forum Excel General
    Replies: 4
    Last Post: 05-08-2006, 02:35 AM
  6. Unable to set Hidden Property
    By LAF in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-24-2005, 07:05 AM
  7. unable to set hidden property
    By davegb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-21-2005, 08:06 PM

Tags for this Thread

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