+ Reply to Thread
Results 1 to 13 of 13

VBA dynamic range keeps showing me an error

  1. #1
    Registered User
    Join Date
    05-02-2022
    Location
    Brazil
    MS-Off Ver
    365
    Posts
    7

    VBA dynamic range keeps showing me an error

    I'm trying to define a dynamic range on my VBA code, but every time I try to execute it I get this message: "vba application-defined or object-defined error".

    Its been 2 days that I'm trying to solve it but everything I tried didnt make it work.

    Error name: "Run-time error '1004': Application-defined or object-defined error"
    Attached Files Attached Files
    Last edited by pedropradi; 05-02-2022 at 11:55 AM. Reason: Removed the picture and saved the macro

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,170

    Re: VBA dynamic range keeps showing me an error

    What is Alertas1
    Sheet is called Alerta1
    Please Login or Register  to view this content.
    Or If Active Sheet then just...
    Please Login or Register  to view this content.
    Anyway...see top yellow banner regarding file upload...
    Last edited by sintek; 05-02-2022 at 09:19 AM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    05-02-2022
    Location
    Brazil
    MS-Off Ver
    365
    Posts
    7

    Re: VBA dynamic range keeps showing me an error

    Thank you for directing me to read the yellow banner. I've corrected my post and "Alerta1" in the macro, but seems like it was not the problem.

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,170

    Re: VBA dynamic range keeps showing me an error

    Thanks for file...Your method of getting last row and last column is incorrect...
    Why not just...
    Please Login or Register  to view this content.
    Also...RULE NO 1 of Excel...Never use merged cells...
    Last edited by sintek; 05-02-2022 at 09:40 AM.

  5. #5
    Registered User
    Join Date
    05-02-2022
    Location
    Brazil
    MS-Off Ver
    365
    Posts
    7

    Re: VBA dynamic range keeps showing me an error

    Didnt understand, sorry im new.

  6. #6
    Registered User
    Join Date
    05-02-2022
    Location
    Brazil
    MS-Off Ver
    365
    Posts
    7

    Re: VBA dynamic range keeps showing me an error

    But, with this method will I be able to change the range dinamically?

  7. #7
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,170

    Re: VBA dynamic range keeps showing me an error

    Look at attached...I got rid of all merged cells and unnecessary rows and columns..
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by sintek; 05-02-2022 at 10:11 AM. Reason: Updated File

  8. #8
    Registered User
    Join Date
    05-02-2022
    Location
    Brazil
    MS-Off Ver
    365
    Posts
    7

    Re: VBA dynamic range keeps showing me an error

    Wow thank you!
    With this method, can I send the sheet in the e-mail?

  9. #9
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,170

    Re: VBA dynamic range keeps showing me an error

    Now this requires a bit more detail...Send sheet how...
    As an attachment...
    As an image attachment...
    As image in body of email...

  10. #10
    Registered User
    Join Date
    05-02-2022
    Location
    Brazil
    MS-Off Ver
    365
    Posts
    7

    Re: VBA dynamic range keeps showing me an error

    Its possible to send this sheet as a image in the body of email?

  11. #11
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,170

    Re: VBA dynamic range keeps showing me an error

    Here you go...
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    05-02-2022
    Location
    Brazil
    MS-Off Ver
    365
    Posts
    7

    Re: VBA dynamic range keeps showing me an error

    Wow this is amazing. I can't thank you enough. THANK YOU THANK YOU THANK YOU!!!!

  13. #13
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,170

    Re: VBA dynamic range keeps showing me an error

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.
    Glad to have helped...Tx for rep +

+ 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] Dynamic Range formula Error
    By ddrace in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-22-2017, 12:42 PM
  2. [SOLVED] excel dynamic range - showing extra row issue
    By shido in forum Excel General
    Replies: 8
    Last Post: 09-15-2015, 11:03 AM
  3. Dynamic Range Rantime error
    By troygeri in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 08-20-2014, 04:56 PM
  4. Error showing if range contain different series
    By satputenandkumar0 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-24-2014, 04:27 AM
  5. Error when selecting dynamic range
    By BoRdo in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-03-2012, 09:04 AM
  6. [SOLVED] Name a dynamic range - Run-time error 1004 Method 'Range' of object'_Worksheet' failed
    By DavidBW in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-03-2012, 08:00 AM
  7. Replies: 5
    Last Post: 07-27-2010, 10:58 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