Search Range for Value (1004 Object Failed)

  • The code I highlighted in Red was changes I tried to make that broke the code.
    Before I changed it was .Range("B5"B31")


    in Cell A1 on both sheets I've input B5:B31, wasn't sure if the issue was because this code runs on one sheet but looks at a range on a different sheet


    The goal was to attempt to prevent someone from having to go into the vba code and change the range if that range on that sheet changes. Recently someone moved the range over from A5:A31 because it looked "Nicer", while it did look better adjusted to the right it broke the code that no one knew how to fix.


  • Hello,


    Looks like the issue is purely ' cosmetics '...


    Why don't you just give a name to your range in your worksheet and use this name in your macro ...


    Then, within your worksheet, you can move the range... every day ... if need be ...without breaking the macro ...

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

  • You are welcome :wink:


    Thanks for your Thanks ... AND for the Like ...:smile:

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!