+ Reply to Thread
Results 1 to 2 of 2

vba for hiding rows

  1. #1
    goofy11
    Guest

    vba for hiding rows

    I'd like to create a macro that will hide rows between to points. The
    spreadsheets I'm working with are always set up the same. The title of the
    spreadsheet is in cell A1. Then column A is blank for a varying number of
    rows (depending on the spreadsheet), until it reaches the column header row
    with the actual data range. There is miscellaneous information in column B.
    I want to be able to hide all the rows between the Title row (always row 1)
    and the column header row (row location varies). The typical setup would
    look like this:

    Column A Column B Column C
    Sales History Report
    miscellaneous
    miscellaneous
    miscellaneous
    miscellaneous

    Item Sales Units
    xxxxx $1,000 500


    Can someone help me with this code?

    Thanks,

    Jeff

  2. #2
    Bob Phillips
    Guest

    Re: vba for hiding rows

    Dim i As Long

    i = 1
    Do
    i = i + 1
    Loop Until Range("A" & i).Value <> ""
    Rows("2:" & i - 1).Hidden = True


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "goofy11" <[email protected]> wrote in message
    news:[email protected]...
    > I'd like to create a macro that will hide rows between to points. The
    > spreadsheets I'm working with are always set up the same. The title of

    the
    > spreadsheet is in cell A1. Then column A is blank for a varying number of
    > rows (depending on the spreadsheet), until it reaches the column header

    row
    > with the actual data range. There is miscellaneous information in column

    B.
    > I want to be able to hide all the rows between the Title row (always row

    1)
    > and the column header row (row location varies). The typical setup would
    > look like this:
    >
    > Column A Column B Column C
    > Sales History Report
    > miscellaneous
    > miscellaneous
    > miscellaneous
    > miscellaneous
    >
    > Item Sales

    Units
    > xxxxx $1,000

    500
    >
    >
    > Can someone help me with this code?
    >
    > Thanks,
    >
    > Jeff




+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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