+ Reply to Thread
Results 1 to 4 of 4

How do I write a macro that hides a row based on data in Excel?

  1. #1
    JJO
    Guest

    How do I write a macro that hides a row based on data in Excel?



  2. #2
    Registered User
    Join Date
    05-20-2005
    Posts
    5

    Use Selection.EntireRow.Hidden = True

    You can write something like:

    If activecell = <your parameters> then Selection.EntireRow.Hidden = True

    Tim

  3. #3
    Chip Pearson
    Guest

    Re: How do I write a macro that hides a row based on data in Excel?

    Try something like

    If Range("A1").Value > 100 Then
    Rows(3).Hidden = False
    Else
    Rows(3).Hidden = True
    End If


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com



    "JJO" <[email protected]> wrote in message
    news:[email protected]...
    >




  4. #4
    Dick Kusleika
    Guest

    Re: How do I write a macro that hides a row based on data in Excel?

    JJO

    You should include your question in the body of your post and use the
    subject line to show the subject. It makes it easier for others to read.
    Here's an example of a macro that hides a row based on the value of a cell.

    Private Sub Worksheet_Change(ByVal Target As Range)

    If Target.Column = 1 Then 'only for column A
    If Target.Value = "HideMe" Then
    Application.EnableEvents = False
    Target.EntireRow.Hidden = True
    Application.EnableEvents = True
    End If
    End If

    End Sub

    For more on events, see here
    http://www.*****-blog.com/archives/2...ng-vba-events/

    --
    **** Kusleika
    Excel MVP
    Daily Dose of Excel
    www.*****-blog.com

    JJO wrote:



+ 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