Consulting

Results 1 to 3 of 3

Thread: If any column in active worksheet is hidden, then the value of cell A1 is “hide”.

  1. #1

    If any column in active worksheet is hidden, then the value of cell A1 is “hide”.

    Hi,

    Could you please write the macro which can perform the following function?

    If any column in active worksheet is hidden, then the value of cell A1 is “hide”.

    Thanks

  2. #2
    VBAX Tutor lynnnow's Avatar
    Joined
    Jan 2005
    Location
    Mumbai, Maharashtra, India
    Posts
    299
    Location
    Are you looking at the entire set of columns or just a bunch of them?

    if you're looking at only a bunch of them, you can try:

    [VBA]Sub ColumnHidden()
    Dim rngColumn As Range
    For Each rngColumn In Range("B1:Z1").Columns
    If rngColumn.Hidden Then Range("A1").Value = "Column " & rngColumn.EntireColumn.Address(0, 0, 1) & " Hidden"
    Next
    End Sub
    [/VBA]

  3. #3
    VBAX Regular HaHoBe's Avatar
    Joined
    Aug 2004
    Location
    Hamburg
    Posts
    89
    Location
    Hi, uktous,

    what about Column A being hidden?

    [vba]Sub WriteToA1()

    [A1] = IIf(Rows(1).Cells.Count <> Rows(1).SpecialCells(xlCellTypeVisible).Cells.Count, "Hide", "")

    End Sub[/vba] Ciao,
    Holger

Posting Permissions

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