+ Reply to Thread
Results 1 to 7 of 7

Hide rows when two cells are blank

  1. #1
    Forum Contributor
    Join Date
    09-16-2014
    Location
    Hyderabad
    MS-Off Ver
    MS Office 2021
    Posts
    347

    Hide rows when two cells are blank

    Hi all!

    I want to hide an entire row, if cell in column B and Column C is blank. I m using the below code but getting an error type Mismatch 13 and highlighting the
    Please Login or Register  to view this content.
    .

    My Data Starts at 190 and ends at 325; hence I am named that range as "Remarks1"

    Column C contains formulas.

    I am using the below code:
    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    11-12-2014
    Location
    Nottingham
    MS-Off Ver
    2013
    Posts
    383

    Re: Hide rows when two cells are blank

    you have defined lr as Long but you have set it equal to a range. That is why you get the error

  3. #3
    Forum Contributor
    Join Date
    09-16-2014
    Location
    Hyderabad
    MS-Off Ver
    MS Office 2021
    Posts
    347

    Re: Hide rows when two cells are blank

    I have changed now to
    Please Login or Register  to view this content.
    Still an error satying Run-time error: 91

    Object Variable or With Block Variable not set.

  4. #4
    Valued Forum Contributor
    Join Date
    11-12-2014
    Location
    Nottingham
    MS-Off Ver
    2013
    Posts
    383

    Re: Hide rows when two cells are blank

    You can use
    Please Login or Register  to view this content.
    to get the last row in that named range where lr is still defined as long (or integer).

    You cannot use it as a range because For i = .. To... requires 2 integers.

  5. #5
    Forum Contributor
    Join Date
    09-16-2014
    Location
    Hyderabad
    MS-Off Ver
    MS Office 2021
    Posts
    347

    Re: Hide rows when two cells are blank

    Still error persits

    Using
    Please Login or Register  to view this content.
    With lr as Long, I am getting Type Mis-match and highlighting
    Please Login or Register  to view this content.
    With lr as Range, I am getting Object Variable or With Block Variable not set and highlighting
    Please Login or Register  to view this content.

  6. #6
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Hide rows when two cells are blank

    Try this one:

    Please Login or Register  to view this content.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  7. #7
    Forum Contributor
    Join Date
    09-16-2014
    Location
    Hyderabad
    MS-Off Ver
    MS Office 2021
    Posts
    347

    Re: Hide rows when two cells are blank

    Thank Arkadi.

    That helped.

+ 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. Hide Rows for First Set of Consecutive Blank Cells in Column
    By pastuslm in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-22-2015, 03:22 PM
  2. Hide Cells with zero values but blank rows should be ignored
    By ckozakos in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-20-2011, 06:27 AM
  3. HIDE ZEROS IN CHART - Hide rows of cells that equals zero
    By sweedey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-09-2011, 08:18 PM
  4. Hide all rows where a range of cells are blank
    By a45ward in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-02-2010, 06:29 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