+ Reply to Thread
Results 1 to 6 of 6

How to fill values between two specific cells?

  1. #1
    Registered User
    Join Date
    11-16-2014
    Location
    Canada
    MS-Off Ver
    2003
    Posts
    7

    How to fill values between two specific cells?

    I have a sheet i'm working on as follows for an automotive inventory

    Column A Column B
    1953 1959
    1953 1956
    1962 1969

    I need to combine the 2 columns and fill in the years between so I'd end up with a column as follows
    Column A
    1953,1954,1955,1956,1957,1958,1959
    1953,1954,1955,1956
    1962,1963,1964,1965,1966,1967,1968,1969

    Is there a way to do this?

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: How to fill values between two specific cells?

    run this macro


    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by mehmetcik; 11-17-2014 at 02:24 PM.

  3. #3
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: How to fill values between two specific cells?

    Please Login or Register  to view this content.
    EDIT: had the output going into individual columns rather than all in A
    Last edited by pjwhitfield; 11-16-2014 at 08:01 PM.
    If someone has helped you then please add to their Reputation

  4. #4
    Registered User
    Join Date
    11-16-2014
    Location
    Canada
    MS-Off Ver
    2003
    Posts
    7

    Re: How to fill values between two specific cells?

    Gives me an error. Which cells should I highlight?

  5. #5
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: How to fill values between two specific cells?

    Which code had error and what was it?

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: How to fill values between two specific cells?

    Here's another one.

    Copy the code at the link below and paste it into a general module.

    https://www.excelforum.com/showthread.php?p=3096647

    Then, to use it...

    Data Range
    A
    B
    C
    D
    1
    Start
    End
    ------
    Concatenated
    2
    1953
    1959
    1953, 1954, 1955, 1956, 1957, 1958, 1959
    3
    1953
    1956
    1953, 1954, 1955, 1956
    4
    1962
    1969
    1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969
    5


    This array formula** entered in D2 and copied down:

    =concatall(ROW(INDIRECT(A2&":"&B2)),", ")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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. Fill out next cell of specific values in a column
    By Ali+786 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-16-2015, 03:33 AM
  2. Create Worksheets and fill specific cells with values
    By corneliusj in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-23-2014, 09:58 AM
  3. Replies: 6
    Last Post: 05-14-2014, 04:56 PM
  4. I would like A1 to auto fill with a specific tect if 3 other cells contain specific text
    By Mattyevs1000 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-09-2014, 03:35 PM
  5. Fill cells with x's between 2 specific columns
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-30-2005, 01:40 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