Consulting

Results 1 to 3 of 3

Thread: Solved: Trouble Hidding Columns

  1. #1
    VBAX Contributor
    Joined
    Aug 2006
    Posts
    120
    Location

    Solved: Trouble Hidding Columns

    Hi, Im having some problems with hidding specific columns. In the second row there are marks that identify the column according to its content. In a workbook_open sentence i created a commandbar that only shows the data i want (Control) in each of its buttons. The problem is I have deleted images, unmerged cells, etc. but I still have an error message concerning objects. Any help deeply apreciated

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    It's the comments that is the problem, see

    http://support.microsoft.com/default.aspx?kbid=211769
    "Cannot shift objects off sheet" error message when you hide columns in Excel

    But you will also have trouble with

    [vba]

    For lvContador = 0 To Range("McInicioTipo").CurrentRegion.Cells.Count - 1
    If Not IsError(Range("McInicioTipo").Offset(, lvContador).Value) Then
    [/vba]

    as the n umber of cells in currentregion could exceed 256, the number of columns. You probably want

    [vba]

    For lvContador = 0 To Range("McInicioTipo").CurrentRegion.Columns.Count - 1
    If Not IsError(Range("McInicioTipo").Offset(, lvContador).Value) Then
    [/vba]

  3. #3
    VBAX Contributor
    Joined
    Aug 2006
    Posts
    120
    Location
    thanks a lot, so basically one must set each object to lvShape.Placement = xlMoveAndSize and turn all comments visible.

Posting Permissions

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