+ Reply to Thread
Results 1 to 2 of 2

Count up from specific row, instead of end: to Hide rows with 'X' in column B

  1. #1
    Registered User
    Join Date
    02-24-2021
    Location
    Guelph, Canada
    MS-Off Ver
    365
    Posts
    10

    Count up from specific row, instead of end: to Hide rows with 'X' in column B

    How to modify existing code, so that the last row is 23, instead of END (very last row used)

    Dim RowNdx As Long
    Dim LastRow As Long

    [CODE]LastRow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row
    For RowNdx = LastRow To 1 Step -1
    If Cells(RowNdx, "B").Value = "x" Then
    Rows(RowNdx).Hidden = True
    End If
    Next RowNdx[/CODE

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,607

    Re: Count up from specific row, instead of end: to Hide rows with 'X' in column B

    Do you mean:
    a) start at 23 and move up?
    For RowNdx = 23 To 1 Step -1

    b) or, start at bottom and go up to 23?
    For RowNdx = LastRow To 23 Step -1
    Ben Van Johnson

+ 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. How to hide some rows based on a specific cell value whilst keeping all unused rows hidden
    By Consultant101 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-15-2021, 06:41 PM
  2. hide rows based on value in specific column
    By beejay67 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-24-2020, 09:27 AM
  3. count of rows where data has been entered in a specific column
    By amenu in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-12-2020, 12:12 AM
  4. Countif, other than ... count a column but dont count specific rows
    By fergnation19 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-13-2019, 12:11 AM
  5. [SOLVED] Hide specific Rows in Sheet1 + hide 5 more in Sheet2
    By bluesurger in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 06-02-2014, 07:19 AM
  6. [SOLVED] First unhide all rows - then hide rows based on specific cell value for a range of cells
    By robbiekh in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-22-2013, 05:46 PM
  7. How to create a macro to hide specific rows where 1st column contains merged cells
    By ascottbag in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-27-2011, 01:16 PM

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