+ Reply to Thread
Results 1 to 2 of 2

Hide rows based on formula result in column A

  1. #1
    Registered User
    Join Date
    10-12-2019
    Location
    texas
    MS-Off Ver
    excel
    Posts
    4

    Hide rows based on formula result in column A

    Been battling this for a bit now, tried a few others solutions found online to no avail...

    I have a spreadsheet in which cells in column A7:A42 have a formula which is 1 if the checkbox in the cell adjacent, i.e. B7:B42, is checked.
    The data in cells C7:I42 is populated via VLookup to another tab.
    What I am wanting to happen is if rows 38 through 42 are blank for rows 38 through 42 to be hidden.

    I tried the below as a test but no go..

    Sub HideColumn2()
    Dim rCell As Range
    Set rCell = Range("A7:A42")

    Rows("7:42").EntireRow.Hidden = False
    If (Not IsEmpty(rCell))
    And (IsNumeric(rCell)
    And (rCell.Value = 0) Then
    Columns("H").EntireRow.Hidden = True
    End If
    End Sub

    Obviously I am not a VBA expert though have been able to muddle along with multiple others so far. Help is greatly appreciated!

  2. #2
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Hide rows based on formula result in column A

    Hey there,

    Firstly, please use code tags when posting code. There's a # button on the toolbar that lets you do this.

    Secondly, your question and code don't make much sense. Are you trying to hide all rows where column A is 0? If so, this should get you through:

    Please Login or Register  to view this content.
    WBD
    Office 365 on Windows 11, looking for rep!

+ 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] auto hide and unhide rows based on formula result in a cell
    By Dena in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 12-13-2017, 05:46 PM
  2. [SOLVED] Macro to Hide/Unhide rows based on the result of a formula
    By c850b in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-20-2015, 12:52 PM
  3. Hide Rows based upon result of a formula
    By kpower in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 11-22-2014, 05:22 PM
  4. hide and unhide rows based on formula result
    By tjanda in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-28-2012, 04:20 AM
  5. Hide/Unhide rows based on cell value (result of formula)
    By tjanda in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-17-2012, 05:57 PM
  6. Auto Hide/Unhide rows in Excel based on formula result in a column
    By crozierk in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 08-12-2012, 08:02 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