+ Reply to Thread
Results 1 to 10 of 10

Show Columns Matching Cell

Hybrid View

  1. #1
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Show Columns Matching Cell

    Hi

    Try this

    Private Sub Worksheet_Change(ByVal Target As Range)
    
      Range("F:AJ").EntireColumn.Hidden = False
      For i = 6 To 36
        If Range("D2") <> "All" And Cells(2, i) <> Range("D2") Or Cells(8, i) < 1 Then
          Cells(1, i).EntireColumn.Hidden = True
        
        End If
      Next i
      Range("E1").Select
    
    End Sub
    I've also changed the final cell selection to be E1 instead of F1 as column F may be hidden at some stage.

    rylo

  2. #2
    Registered User
    Join Date
    04-12-2010
    Location
    Los Angeles, USA
    MS-Off Ver
    Excel 2021
    Posts
    9

    Re: Show Columns Matching Cell

    Perfect, it seems so simple when I see it. Need to commit to learning the language. Thank you kindly again.

+ 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