ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Selecting Contiguous data that contains many empty cells (https://www.excelbanter.com/excel-programming/292441-selecting-contiguous-data-contains-many-empty-cells.html)

Rodrigo[_3_]

Selecting Contiguous data that contains many empty cells
 
Hello !

I am working on a big spreadsheet that contains dozens of smaller tables. All of these smaller tables have the word "keyword" in the cell at their top-left corner. I have used the code

Worksheets(1).UsedRange.Find("keyword"

and also the method "FindNext" to successfully locate all cells that contain the "keyword" sucessively in a loop. My problem is, I need to SELECT each of those small tables to their entirety, even if there are blank cells on the first row, or in the first column, or anywhere. Basically, I need to select all rows and columns pertaining to the range of contiguous data, even though the table may look like a "swiss cheese" of information, as long as there are no empty rows or columns crossing somewhere in the middle of the table

Do you think you could help me

Thank you in advance!

Tom Ogilvy

Selecting Contiguous data that contains many empty cells
 
range("Z10").CurrentRegion

as long as there is no comletely blank row or column within the data.

in the example, if AA10, AA11 and Z11 were all blank, it would fail because
the "Data" would just be Z10 at that point. Other than that, it should work
within the limitations stated.

--
Regards,
Tom Ogilvy

"Rodrigo" wrote in message
...
Hello !!

I am working on a big spreadsheet that contains dozens of smaller tables.

All of these smaller tables have the word "keyword" in the cell at their
top-left corner. I have used the code

Worksheets(1).UsedRange.Find("keyword")

and also the method "FindNext" to successfully locate all cells that

contain the "keyword" sucessively in a loop. My problem is, I need to
SELECT each of those small tables to their entirety, even if there are blank
cells on the first row, or in the first column, or anywhere. Basically, I
need to select all rows and columns pertaining to the range of contiguous
data, even though the table may look like a "swiss cheese" of information,
as long as there are no empty rows or columns crossing somewhere in the
middle of the table.

Do you think you could help me?

Thank you in advance!





All times are GMT +1. The time now is 05:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com