You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
I am working on, let's say sheet2 and have data on sheet8 starting at "G7". I never know how much data will occupy the column, so
I'd like to find the rowcount of the last value before a blank cell in column "G7".
How would the code be written. I have tried many things, all of which are not returning what I am looking for.
The return value I want is, well, Let's say for example data starts at "G7" and ends at "G20" and G21 is blank. I want the return value that counts from G7 to G21 which would be "14".
This only works if the colums to the left and right, and the rows above cell G7 are empty - other wise will count extra rows - so may not be exactly what you're after?
Could always write a do loop with activecell.offset, checking for blank cell - but may be a bit like overkill!!