Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50070

Selecting All Used Rows Including and Underneath Specific Value

$
0
0
Hello World!

I have been working on an excel worksheet that is generated by one of our project reporting systems. The system exports to excel all of the financial information for the project being reviewed.

Every generated worksheet has the word Programme somewhere in Column B, however, given each project produces a worksheet with varying rows, Programme can appear anywhere from B6:B999.

I would like to select all rows beneath and including the word Programme.

Code:

    Cells.Find(What:="Programme", LookAt:=xlWhole).Activate
    Rows(ActiveCell.Row).Select
    Selection.Offset(1, 0).Select

The above code searchs for Programme and then selects the row and then moves the selection one row beneath.

I need the code to search for Programme, select that row, and then include all rows below in the selection.

Inspiration?

Viewing all articles
Browse latest Browse all 50070

Trending Articles