+ Reply to Thread
Results 1 to 5 of 5

Hide Row Based on Error in Cell--Excel 2010

Hybrid View

LadyNatira Hide Row Based on Error in... 12-16-2014, 11:21 AM
Mumps1 Re: Hide Row Based on Error... 12-16-2014, 11:56 AM
LadyNatira Re: Hide Row Based on Error... 12-16-2014, 12:03 PM
walruseggman Re: Hide Row Based on Error... 12-16-2014, 11:56 AM
LadyNatira Re: Hide Row Based on Error... 12-16-2014, 12:03 PM
  1. #1
    Registered User
    Join Date
    12-16-2014
    Location
    Minneapolis
    MS-Off Ver
    2010
    Posts
    9

    Question Hide Row Based on Error in Cell--Excel 2010

    I would like to hide entire rows if there is a #NUM! error in a specific column--column U in this case. I've tried this:

    Sub Macro1()
    Columns("U").SpecialCells(xlCellTypeFormulas, 16).EntireRow.Hidden
    End Sub

    . . . for which I get a Hidden method of Range class failed error.

    Any suggestions?
    Last edited by LadyNatira; 12-16-2014 at 12:06 PM. Reason: SOLVED

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,049

    Re: Hide Row Based on Error in Cell--Excel 2010

    Try:
    Columns("U").SpecialCells(xlConstants, xlErrors).EntireRow.hidden=true
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    12-16-2014
    Location
    Minneapolis
    MS-Off Ver
    2010
    Posts
    9

    Re: Hide Row Based on Error in Cell--Excel 2010

    Quote Originally Posted by Mumps1 View Post
    Try:
    Columns("U").SpecialCells(xlConstants, xlErrors).EntireRow.hidden=true

    No cells found on this one, but thanks for the suggestion!

  4. #4
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Hide Row Based on Error in Cell--Excel 2010

    How about something like this?

    Sub Natira()
    Set CheckRange = Range("U1:U" & Cells(Rows.Count, "U").End(xlUp).Row)
    
    For Each Cell In CheckRange
    If Cell.Text = "#NUM!" Then
        Cell.EntireRow.Hidden = True
    End If
    Next
    End Sub

  5. #5
    Registered User
    Join Date
    12-16-2014
    Location
    Minneapolis
    MS-Off Ver
    2010
    Posts
    9

    Re: Hide Row Based on Error in Cell--Excel 2010

    Quote Originally Posted by walruseggman View Post
    How about something like this?

    Sub Natira()
    Set CheckRange = Range("U1:U" & Cells(Rows.Count, "U").End(xlUp).Row)
    
    For Each Cell In CheckRange
    If Cell.Text = "#NUM!" Then
        Cell.EntireRow.Hidden = True
    End If
    Next
    End Sub
    This one worked like a charm!

    Yipee and thank you so much!

+ 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. [SOLVED] Excel 2010 - Icon Set (3 conditions) Based on Cell Value Across
    By robynn in forum Excel General
    Replies: 5
    Last Post: 09-24-2014, 02:03 PM
  2. Trying Hide #N/A Error's on Excel 2010
    By MatthewIJClark in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-28-2014, 07:01 AM
  3. Error calling Outlook 2010 macros from Excel 2010
    By MitcheMJ in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-11-2013, 04:48 PM
  4. Replies: 8
    Last Post: 11-09-2012, 07:28 AM
  5. [SOLVED] Can Excel hide a row automatically based on value in a cell?
    By RJQMAN in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-07-2005, 04:05 AM

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