+ Reply to Thread
Results 1 to 2 of 2

Copy down values in variable range

  1. #1
    Registered User
    Join Date
    08-02-2016
    Location
    Utrecht
    MS-Off Ver
    2010
    Posts
    14

    Copy down values in variable range

    Hi all,

    I have created a macro that will automatically populate a column with all variations of a keyword including a space. There are 4 additional columns with standard values which I would like to have my macro copy down for all populated cells in the list. I'm struggling however to define the range for which to copy these values, given that the length of the range for which to copy varies.


    In the attached example, there are now 5 values in the column on the left, but this could also be 10 values, 15, 18, etc. (in other words it varies) What I'm looking for specifically is that if I run the macro, it will copy the contents of the selected cells down, up and until the last row of the list of keywords. In the example that would mean up and until the row of 'Example 4' This would normally done be done by double-clicking the small box on the bottom right, but I need to know how to do this in VBA code

    Is anyone able to help me with defining this variable range as well as the expression to copy the values down subsequently?

    THanks a lot!


    Addition:

    I have a gut feeling it will be something like
    Please Login or Register  to view this content.
    , where Z8 is the variable value (e.g. the countblank of V3:V258 - the max number of values generated is 255)


    Example.JPG
    Last edited by DanielZig; 05-19-2020 at 07:32 AM.

  2. #2
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,143

    Re: Copy down values in variable range

    Try,

    "A1" => Reference Point (the first cell of the upper-left corner of the "data table") - change as needed.
    One row of headers only.
    There are no entries around adjacent cells in the table (one-row and one-column gap around the "table").
    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. Copy a range to a variable and restore the range from the variable
    By DonaldDukw in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-19-2020, 11:34 AM
  2. [SOLVED] Macro to select a variable row range and copy it down a variable amount of times
    By JPoFresh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-19-2019, 10:40 AM
  3. [SOLVED] Macro to select a variable cell range and copy it down a variable amount of times
    By JPoFresh in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 07-18-2019, 09:17 PM
  4. Copy variable range from variable workbook to variable range on current workbook
    By Locster79 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-09-2013, 10:37 AM
  5. [SOLVED] Copy range from multiple sheets, into a master sheet and moving over by variable col range
    By g1eagle in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-23-2012, 01:36 PM
  6. [SOLVED] Copy/Paste Values from Variable Range to Corresponding Variable Range
    By Cpetersoc in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-14-2012, 08:20 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