+ Reply to Thread
Results 1 to 7 of 7

VBA If/Then Error Help Needed

  1. #1
    Registered User
    Join Date
    05-20-2014
    Location
    Salt Lake City, Utah
    MS-Off Ver
    2013
    Posts
    31

    Unhappy VBA If/Then Error Help Needed

    Hi. I'm needing to add a new column ("O") to a worksheet that adds text alerts when any dates from column "M" fall outside a defined date range (first day of current year to last day of current month). The script keeps stopping at the first "If" line, with a "Run-time error '1004': Application defined or object-defined error". A few hours of Googling possible VBA solutions hasn't helped, but maybe I'm looking too hard. It IS Friday after all...

    Thanks for any help!

    Please Login or Register  to view this content.
    Last edited by Quinn.Farley; 07-15-2016 at 08:42 PM. Reason: Fixed Code Display

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: VBA If/Then Error Help Needed

    Please Login or Register  to view this content.
    Last edited by bakerman2; 07-15-2016 at 08:30 PM.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Registered User
    Join Date
    05-20-2014
    Location
    Salt Lake City, Utah
    MS-Off Ver
    2013
    Posts
    31

    Re: VBA If/Then Error Help Needed

    That was awesome! So quick! Thank you, it completely worked. I don't know why I hadn't seen the absence of the Offset in my cell reference -I'd just mentally assumed it. It IS Friday.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,933

    Re: VBA If/Then Error Help Needed

    QuinnYour post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Registered User
    Join Date
    05-20-2014
    Location
    Salt Lake City, Utah
    MS-Off Ver
    2013
    Posts
    31

    Re: VBA If/Then Error Help Needed

    Yeah, I tried doing that, then clicked the review a few times, both by typing a hashtag at each end, then clicking the button, but each review showed the same flat code. I'll re-read about tags on the link you gave me. Apologies for not complying. I tried.

  6. #6
    Registered User
    Join Date
    05-20-2014
    Location
    Salt Lake City, Utah
    MS-Off Ver
    2013
    Posts
    31

    Re: VBA If/Then Error Help Needed

    Ok, I clicked the hashtag button once at top and once at bottom, creating two sets of empty codes and encapsulating exactly none of mine. Won't happen again.

  7. #7
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: VBA If/Then Error Help Needed

    You're welcome and thaks for the rep points.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] VBA help needed to capture Error and Remove Pivot if error exist else resume
    By Tescatlipoca in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-18-2014, 05:46 PM
  2. RUN TIME ERROR '1004' error handling help needed
    By skop89 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-09-2014, 12:54 PM
  3. [SOLVED] Error (again), IF needed
    By JonathanB2 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-01-2014, 03:09 PM
  4. Help needed with #REF! error (arrays)
    By robotlust in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-17-2008, 08:53 PM
  5. Automation Error help needed
    By funkymonkUK in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-23-2006, 09:46 AM
  6. [SOLVED] .dll error message help needed
    By Wylie C in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-01-2005, 04:09 PM
  7. [SOLVED] Compiling error! VBA Help needed
    By Mary in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-16-2005, 03:06 AM

Tags for this Thread

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