+ Reply to Thread
Results 1 to 6 of 6

Multiplerows data into single cells based on row numbers

  1. #1
    Forum Contributor
    Join Date
    10-22-2014
    Location
    Indonesia
    MS-Off Ver
    2010
    Posts
    177

    Multiplerows data into single cells based on row numbers

    Hello,

    I have Excel file in two column.
    first column = Number
    Second column = data

    I need to combine multirows data into single one.
    i have work vba, but this only work if i have blank row between each number.

    Would be happy if anywant may check the attach file and give suggestion.

    Thank you in advance.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,028

    Re: Multiplerows data into single cells based on row numbers

    i have work vba, but this only work if i have blank row between each number.
    You mean blank row or blank cell?
    Your sample has blank cell between each number, is that the original condition?

  3. #3
    Forum Contributor
    Join Date
    10-22-2014
    Location
    Indonesia
    MS-Off Ver
    2010
    Posts
    177
    Quote Originally Posted by Akuini View Post
    You mean blank row or blank cell?
    Your sample has blank cell between each number, is that the original condition?
    Hello,

    Thank you for your reply, yes it has blank cells between each number.

  4. #4
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Multiplerows data into single cells based on row numbers

    Try this for results starting "G1"
    Please Login or Register  to view this content.
    Regards Mick

  5. #5
    Forum Contributor
    Join Date
    10-22-2014
    Location
    Indonesia
    MS-Off Ver
    2010
    Posts
    177

    Re: Multiplerows data into single cells based on row numbers

    Thanks MickG !!

    It works perfectly.

    i think it's solved.

    i have only little known of vba, just curious do you have source where i can learn above? that explain about what is "temp", "ReDim", "Preserve".

  6. #6
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Multiplerows data into single cells based on row numbers

    You're welcome.
    Nb:- You can Google "Redim Preserve" for a more formal answer, but basically
    it Enables you to increase the size of an array when you don't know how big it needs to be.
    In the code each time "c" increases (that's when the data found in column "A" is not an empty cell) then the size of the array increases by one.
    NB:- The thing to remember is that you can only increase the last dimension of the array. In order to do that you have to transpose the array so the columns are the rows and the rows are the columns.
    In the code the array looks like:- Redim Preserve ray(1 to2,1 to c) . So you now see the column (1 to 2) are now at the front and the rows (1 to c) are the last dimension.
    The last thing the to remember is that when you place the array on the sheet you need to Transpose the array back to (application.transpose(ray)) to show the array correctly on the sheet.
    Hope that helps

+ 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. Replies: 3
    Last Post: 08-26-2015, 02:02 PM
  2. Enter data into cells based on single cell data
    By lawrence24 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-09-2014, 03:11 AM
  3. [SOLVED] Generating: letters from cell contents, & numbers based on number of cells containing data
    By excellenct in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-04-2014, 06:14 AM
  4. [SOLVED] formula to sum numbers based off of single or matching dates
    By nicki_rae22 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-21-2014, 01:24 PM
  5. Replies: 11
    Last Post: 10-16-2013, 10:21 PM
  6. [SOLVED] GetMatch plus VBA Code to Extract Matched Numbers from 2 Single Cells
    By david gonzalez in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 02-18-2013, 05:08 PM
  7. [SOLVED] Create serial numbers based on a single input number.
    By jmp601 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-08-2013, 11:33 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