+ Reply to Thread
Results 1 to 5 of 5

unable to change range in code

  1. #1
    Forum Contributor
    Join Date
    02-01-2011
    Location
    london, england
    MS-Off Ver
    Excel 2016
    Posts
    179

    unable to change range in code

    hi guys,

    the code below sends an email to a fixed recipient when a date has passed (column L) and another cell is blank (column M), however, it sends an email for every row on the table, i need just one email, so if M2 is blank, i need 1 email sent.

    Now i didn't write this code, and i only half understand it - but i figured if i shortened the range it looked at (ie change l65536 to l2), then perhaps it would only check the first line of data and therefore only send 1 email - however when i do this, instead of sending loads of emails, it doesn't send any....

    can anyone help?

    Please Login or Register  to view this content.
    Last edited by fabrecass; 01-21-2013 at 10:31 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    08-13-2012
    Location
    Gardony, Hungary
    MS-Off Ver
    Excel 2003
    Posts
    558

    Re: unable to change range in code

    The loop in the macro starts from 13 and ends at the row number of the last row with data in column L.

    So if you want to just have one row (row #13), change this line
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

    edit: there seem to be some illogical references in your code, but if it works, why change it I guess...

  3. #3
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: unable to change range in code

    fabrecass,

    I have tried to simplify the code a bot (just removed what was not used), so the following code should do what you want it do

    Please Login or Register  to view this content.
    If you like my contribution click the star icon!

  4. #4
    Forum Contributor
    Join Date
    02-01-2011
    Location
    london, england
    MS-Off Ver
    Excel 2016
    Posts
    179

    Re: unable to change range in code

    thanks guys, both answers solved my issue, i've used your code OllieB and it's fantastic! thank you so much!

  5. #5
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: unable to change range in code

    Quote Originally Posted by fabrecass View Post
    thanks guys, both answers solved my issue, i've used your code OllieB and it's fantastic! thank you so much!
    You are very welcome. Please remember to mark your thread as SOLVED and click the star icon if you are happy with my contribution!

+ 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