+ Reply to Thread
Results 1 to 8 of 8

Set range only up until blank row in a particular column

  1. #1
    Registered User
    Join Date
    02-10-2010
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2002
    Posts
    28

    Set range only up until blank row in a particular column

    Hi All,

    "Leith" has been phenomenally helpful in helping me out with the bulk of this report I'm trying to figure out. He's basically re-written my code in order to send an e-mail with a particular range in the body of the email.

    There's one more thing I'm trying to figure out and that's how to only select the rows up until the first blank cell in column A.

    Below is the code that he provided and I've attached an example spreadsheet. In the spreadsheet I want to send range A1:L24 (because L25 has the first blank cell beginning at A4). All the e-mail code works, I just need help figuring out how to send this particular range. The entries are dynamic, so it won't always be up until row 24...it needs to be only up until the first blank cell in Column A beginning at Row 4:

    Please Login or Register  to view this content.




    Any help would be greatly appreciated!
    Attached Files Attached Files
    Last edited by Leith Ross; 09-17-2011 at 12:28 PM. Reason: Added Code Tags

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Set range only up until blank row in a particular column

    Hello seaottr,

    This will size the emaqil range based on the entries in column "A".
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    02-10-2010
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2002
    Posts
    28

    Re: Set range only up until blank row in a particular column

    Thanks again Leith, but I'm actually trying to find the Row number of the last blank cell in the Range A4:A30. Maybe it's because there's a formula in those cells that it doesn't register as being "blank".

    If you try your code in the attachment that I posted, it doesn't send A1:J24, it sends A1:J31.

    The "blank" cells in Range A1:A30 have formulas in them (A25:A30), but no actual values, therefore I don't want to include them in the e-mail.

    Let me know if there's any way to do this.

    Thanks in advance!

    Quote Originally Posted by Leith Ross View Post
    Hello seaottr,

    This will size the emaqil range based on the entries in column "A".
    Please Login or Register  to view this content.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Set range only up until blank row in a particular column

    Hello seaottr,

    I forgot about the formulas in column "A". The only reliable way is to check each cell's value using a loop. Here is the working code for the CommandButton2.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-10-2010
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2002
    Posts
    28

    Re: Set range only up until blank row in a particular column

    Awesome! Thanks buddy!

    LAST request (I promise)!!! LOL!

    The bottom border is missing from the table in the email body (the range that's being sent). How do I get it to show up?

    Thanks again for all your help!

    Quote Originally Posted by Leith Ross View Post
    Hello seaottr,

    I forgot about the formulas in column "A". The only reliable way is to check each cell's value using a loop. Here is the working code for the CommandButton2.
    Please Login or Register  to view this content.

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Set range only up until blank row in a particular column

    Hello seaotter,

    I noticed that also. Unfortunately, I have idea why it isn't showing up. I even tried including a blank row. While this displays the top border for the last entry, the blank row's bottom border is still missing.

  7. #7
    Registered User
    Join Date
    02-10-2010
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2002
    Posts
    28

    Re: Set range only up until blank row in a particular column

    Yes, I tried that as well and noticed the same thing

    Hopefully someone else can help us figure it out?

    If you know how to insert a blank row after the range it sends and include this blank row in the range, it will work (I've tried this manually). Just not sure how to do this?

    Quote Originally Posted by Leith Ross View Post
    Hello seaotter,

    I noticed that also. Unfortunately, I have idea why it isn't showing up. I even tried including a blank row. While this displays the top border for the last entry, the blank row's bottom border is still missing.
    Last edited by seaottr; 09-17-2011 at 06:53 PM.

  8. #8
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Set range only up until blank row in a particular column

    Hi seaottr

    Try the code in the attached...see if it resolves this issue
    The bottom border is missing from the table in the email body (the range that's being sent). How do I get it to show up?
    Attached Files Attached Files
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

+ 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