+ Reply to Thread
Results 1 to 4 of 4

Stop macro unhiding at a certain row

  1. #1
    Forum Contributor
    Join Date
    01-18-2013
    Location
    England
    MS-Off Ver
    2016 (Mac)
    Posts
    149

    Stop macro unhiding at a certain row

    Hello Eveyone,

    I am trying to change the below VB code to stop unhiding rows below row 35? There are other hidden rows below row 35 that I do not want to be revealed when this macro is run. Perhaps once row 35 has been unhidden then if the macro is run again an alert box can be displayed?

    Is there anyone that is able to edit the below code in order for me to achieve this:

    Sub UnhideLastRow()
    Dim lHiddenRws As Long
    With Cells.SpecialCells(xlCellTypeVisible)
    lHiddenRws = .Areas(1).Rows.Count + 1
    .Areas(1)(lHiddenRws, 1).EntireRow.Hidden = False
    End With
    End Sub

    Thank you very much for any help.

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Stop macro unhiding at a certain row

    How about:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Valued Forum Contributor ffffloyd's Avatar
    Join Date
    05-20-2008
    Location
    Perth, WA, Australia
    MS-Off Ver
    Office 365
    Posts
    245

    Re: Stop macro unhiding at a certain row

    Not tested but I would think, just as a quick answer:
    Please Login or Register  to view this content.
    I have a bit of a problem though with the way you're setting lHiddenRows to the number of rows in the area and one more. It seems to me that if you do that and then refer to that row as a range index within the area then it is going to flag an error due to it being outside the range. Assuming you've done this though and that I am wrong, I have taken the same approach with rngArea. Using the Intersect(*) function should at least point you in the right direction.
    _______________
    Floyd Emerson
    Business Intelligence Consultant
    Melbourne, Victoria, Australia

  4. #4
    Registered User
    Join Date
    04-16-2012
    Location
    Space
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Stop macro unhiding at a certain row

    For i = 1 tor 35 Step + 1

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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