+ Reply to Thread
Results 1 to 8 of 8

Dynamic Range + error message

  1. #1
    Forum Contributor
    Join Date
    01-26-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    311

    Dynamic Range + error message

    Been working on the following macro:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Although I've come across two problems which I can't quite solve:

    1. The "311" part of the range needs to be dependant on whether there's a data point after that value (i.e. dynamic).

    2. As the macro is working, it'll post that a column is being overwritten. This needs to be automatically approved - instead of me clicking "yes" every time

    Solutions to the following problems would be massively appreciated

    Ty
    Mdn
    Attached Files Attached Files

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Dynamic Range + error message

    Is the "Text to columns" part of your code meant to overwrite the Selection ID column?

    BSB

  3. #3
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Dynamic Range + error message

    1. To make range dynamic.

    Please Login or Register  to view this content.
    Or you can store last row in variable like...
    Please Login or Register  to view this content.
    Then you can use it like.
    Please Login or Register  to view this content.
    2. Turn off Application.DisplayAlerts to false before the operation and turn it back to true after operation.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  4. #4
    Forum Contributor
    Join Date
    01-26-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    311

    Re: Dynamic Range + error message

    Quote Originally Posted by CK76 View Post
    1. To make range dynamic.

    Please Login or Register  to view this content.
    I'm a bit of a novice when it comes to VBA, but replacing the "range" with the code gives me a couple of errors. What did I do wrong?

    Please Login or Register  to view this content.

  5. #5
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Dynamic Range + error message

    Something like below?
    Please Login or Register  to view this content.

  6. #6
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Dynamic Range + error message

    Try this:
    Please Login or Register  to view this content.
    BSB

  7. #7
    Forum Contributor
    Join Date
    01-26-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    311

    Re: Dynamic Range + error message

    That's bril (CK & BSB) massively appraicted!
    Last edited by Median; 05-28-2018 at 03:25 PM.

  8. #8
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Dynamic Range + error message

    You are welcome and thanks for the 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] Error message if value is noth within range
    By vonrainer in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-30-2014, 01:19 AM
  2. Dynamic Chart - Invalid reference error message
    By Anthony2 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 03-12-2014, 04:00 AM
  3. Replies: 0
    Last Post: 07-31-2013, 06:03 AM
  4. Replies: 0
    Last Post: 03-10-2013, 11:17 PM
  5. [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
  6. Replies: 5
    Last Post: 07-27-2010, 10:58 AM
  7. out of range error message
    By juergenkemeter in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-19-2006, 02:10 AM

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