+ Reply to Thread
Results 1 to 2 of 2

Fill rows in range with offset

  1. #1
    Registered User
    Join Date
    02-25-2020
    Location
    Scandinavia
    MS-Off Ver
    2016
    Posts
    1

    Fill rows in range with offset

    Hi

    I have an excel sheet where I want to fill down the rows in a column with VBA, using offset and the range between two other cell values.

    To exemplify;

    1) I want to fill out the E-column. It has to be filled with values in the range between the values in C2 and D2.
    So if the value in C2 is 1 and D2 is 20, E has to be filled 20 rows down, with sequential numbers.

    2) Furthermore, I want to be able to use the macro on multiple columns. So instead of having to specify i.e. C2 and D2, I want to use offset.
    So E is filled with values between C2 and D2, F is filled with values between D2 and E2, etc.

    The only code I have gotten to work with offset, is one where the value filled in is static (so I have to specify e.g. value = 1, instead of using a cell reference)
    I have no idea how to make all this work.

    I hope someone can help, let me know if you need more info.
    Thanks

  2. #2
    Valued Forum Contributor
    Join Date
    01-14-2013
    Location
    Austria
    MS-Off Ver
    2016 / 2019
    Posts
    339

    Re: Fill rows in range with offset

    attach a sample workbook with input sample and expected result and also your macro.
    It is much easier to work with it without setting up everything first

+ 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] Offset range by (0,1) then resize Rows -2 & columns -1
    By eazy899 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-01-2018, 04:11 AM
  2. Creating Dynamic Range Using OFFSET and COUNTA Adds Extra Rows
    By jcox1953 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-25-2014, 12:44 PM
  3. VBA code to copy cell formats and paste using offset for Rows/Range
    By spenlinhauer in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-12-2014, 07:45 PM
  4. Replies: 1
    Last Post: 02-04-2014, 01:57 PM
  5. [SOLVED] Fill range of rows based on a value
    By myownworld in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-18-2013, 02:11 PM
  6. Fill a LISTBOX from a range, WHITOUT BLANK ROWS
    By aleebaba in forum Excel - New Users/Basics
    Replies: 11
    Last Post: 11-07-2011, 03:06 AM
  7. Deleting blank rows in a range or another fill approach
    By BigDave in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-03-2005, 11:05 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