1. Welcome to Chandoo.org Forums. Short message for you

    Hi Guest,

    Thanks for joining Chandoo.org forums. We are here to make you awesome in Excel. Before you post your first question, please read this short introduction guide. When posting or responding to questions please remember our values at Chandoo.org are: Humility, Passion, Fun, Awesomeness, Simplicity, Sharing Remember that we have people here for whom English is not there first language and we need to allow for this in our dealings.

    Yours,
    Chandoo
  2. Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  3. When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Combines 2 range of data untill the input is empty

Discussion in 'VBA Macros' started by Prasoonj, Mar 13, 2018.

  1. Prasoonj

    Prasoonj New Member

    Messages:
    11
    Dear All
    Greetings !!

    I'm new to Macro coding and need your support on my below query
    I have a Range of data and common codes separately . I'm looking for a code which combines both and results as below

    Have attached a file with a scenario . Please need your best support to simply my work.

    Thank you ! Awaiting your Kind reply

    Attached Files:

  2. vletm

    vletm Excel Ninja

    Messages:
    4,418
    Prasoonj
    Something like this ...
    Follow instructions!
    with [ Do It ]?

    Attached Files:

    Khalid NGO likes this.
  3. Prasoonj

    Prasoonj New Member

    Messages:
    11
    Thank you sir ,

    Code works perfectly for what i have suggested but some more i have missed to explain you in my previous post. Sorry for the inconvience

    Attached again the input data file and code original codes which i use for the processing.

    Highlighted in Yellow color in the file - Default code needs to appear for all single contract in the same sequence i have given along with input modified by data codes.

    Highlight in Green color - Based on Input and Common code given( which I already perfect now with the help of codes provided but need to include (") Quotation mark in the last (suffix)

    And at last, Results are coming with a Space between each contract which is not required. Thank you for your interest in teaching me !!!!

    Attached Files:

  4. vletm

    vletm Excel Ninja

    Messages:
    4,418
    Prasoonj
    It would a miracle if something would work after missing information and
    if You have changed layout of sheet
    Screen Shot 2018-03-15 at 09.40.11.png Left new layout -- right original layout.

    and changed code ... someway ... hmm?
    I changed back.

    I could only guess about Your named colors ...
    so I have to skip that part.

    And at last, Results are coming with a Space between each contract which is not required.
    ... Hmm? As in both 'samples' there were ONE colorful row between something.
    I needed to guess, that You won't need that text there...
    Screen Shot 2018-03-15 at 09.54.52.png

    The sample file would be as close as possible with the real file.

    Attached Files:

  5. Prasoonj

    Prasoonj New Member

    Messages:
    11
    Hi Sir,

    where is a lot of confusion due to i have inserted a row and the comments what i have given is very generic.

    Now attach the new file with what really i do here with the same code and same format.
    Please refer the attachment and help me in finding a code.

    Attached Files:

  6. vletm

    vletm Excel Ninja

    Messages:
    4,418
    Prasoonj
    Have You ...
    Screen Shot 2018-03-19 at 14.47.03.png
    the original case above and the new case below - okay?
    Screen Shot 2018-03-19 at 14.47.22.png
    The original has dates as dd/mm/yyy - okay? and
    the new has dates as dd.mm.yyyy (are You 100% sure that those are given as dates?)

    The original has three common codes - okay? and
    the new has ... two common code - okay?

    The original worked ... even NO extra row between Contract#

    The new would like to have some extra rows between Contract#s ...?

    The new ... hmm
    ... even snapshow has already used four kind of 'common codes',
    You have named two ... hmm?

    >> with two 'common codes' this would be a challenge! <<
  7. Prasoonj

    Prasoonj New Member

    Messages:
    11
    Dear Sir,

    1.Date as per new - dd.mm.yyyy
    2 . Common code - as per new , 1st common code for start and end date , 2nd common code for Esc date.
    3.Below screenshot to specific the content color wise, Green color are Common code + inputs, Blue color are default data for each contract processing which is must.
    upload_2018-3-21_17-50-26.png

    New file is the exact data and my requirement . thank you !
  8. vletm

    vletm Excel Ninja

    Messages:
    4,418
    Prasoonj
    1) Those are NOT dates! Previous file has dates, those CANNOT change vary!
    2) Did You even try to check Your sample file?
    ONLY '~green' 'Common code with input data'-strings are fixed!
    OTHER '~blue' are 'whatever'!
    >> If Your sample file is out from this case then no work! <<

    If as You wrote:
    New file is the exact data and my requirement . thank you !... then good luck!

Share This Page