+ Reply to Thread
Results 1 to 4 of 4

Macro to extend range

  1. #1
    Registered User
    Join Date
    03-26-2015
    Location
    wisconsin, united states
    MS-Off Ver
    2010
    Posts
    47

    Macro to extend range

    Please Login or Register  to view this content.
    Would someone be willing to assist me in making the range in this code a variable that starts at (A2, A10) then goes adds ten to the end of the range whenever a different macro is executed?

    Lets say that different macro is called Macro X

    So when Macro X is executed, the range in this private sub will add ten and become (A2, A20)....

    If ran again it will be (A2, A30) (A2, A40)...etc.

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Macro to extend range

    A suggestion could be
    in ThisWorkbook
    Please Login or Register  to view this content.
    in a module


    Please Login or Register  to view this content.
    Then each macro call once UpdataRg as Test() is doing
    Attached Files Attached Files
    - Battle without fear gives no glory - Just try

  3. #3
    Registered User
    Join Date
    03-26-2015
    Location
    wisconsin, united states
    MS-Off Ver
    2010
    Posts
    47

    Re: Macro to extend range

    Two things I'm stuck on the option explicit before it creates a line between the two...
    Also do I just replace the UpdataRg with the name of the Macro that triggers the update?

  4. #4
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Macro to extend range

    "option explicit" is just to ask VBA to check that all variables have been define with the Dim statement
    "the Macro that triggers the update" is "Sub Test()", it means inside your macro put
    Please Login or Register  to view this content.

+ 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. Extend range. someone can help?
    By Henk in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-01-2015, 12:06 PM
  2. Macro to extend a table range
    By qaliq in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-11-2013, 09:38 AM
  3. [SOLVED] Extend copy range of a macro in a query file
    By Consty1 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-30-2013, 04:34 PM
  4. [SOLVED] Painting Range - extend the range on the top part
    By Shrikant in forum Excel General
    Replies: 4
    Last Post: 09-01-2005, 07:05 AM
  5. Extend range to sum
    By Ivor Williams in forum Excel General
    Replies: 2
    Last Post: 03-19-2005, 05:06 PM

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