• 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...

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

Copy and Paste a Range based on the variable value

I have a spreadsheet with many columns. However, 2 of them may have multiple values

that need to be split in different rows. What I want to do is, when I find the

cells with multiple value {Chr (10)}, I need to split them in the following rows (below) and keep all the others information from the same row. Let's suppose I have

in the cell A1 three different Part Numbers (Chr 10) and, in the cell B1, the a price for them. The macro should split the Part Number in the e three different rows (A1, A2 and A3) and the price should be kept in the cell B1. The problem is the number of the values inside the same cell could vary and this number should drive the number of rows to be inserted, copied and paste.


Any help would be very appreciated

Thanks in advance

AGM
 
Hi, motabrasil!


First of all welcome to Chandoo's website Excel forums. Thank you for your joining us and glad to have you here.


As a starting point I'd recommend you to read the green sticky topics at this forums main page. There you'll find general guidelines about how this site and community operates (introducing yourself, posting files, netiquette rules, and so on).


Among them you're prompted to perform searches within this site before posting, because maybe your question had been answered yet.


Feel free to play with different keywords so as to be led thru a wide variety of articles and posts, and if you don't find anything that solves your problem or guides you towards a solution, you'll always be welcome back here. Tell us what you've done, consider uploading a sample file as recommended, and somebody surely will read your post and help you.


And about your question...


If you haven't performed yet the search herein, try going to the topmost right zone of this page (Custom Search), type the keywords used in Tags field when creating the topic or other proper words and press Search button. You'd retrieve many links from this website, like the following one(s) -if any posted below-, maybe you find useful information and even the solution. If not please advise so as people who read it could get back to you as soon as possible.


Despite of this, give a look at this file. It uses only formulas (no VBA code) and perhaps you find it useful. Just advise if any issue or macro required.

https://dl.dropboxusercontent.com/u/60558749/Copy%20and%20Paste%20a%20Range%20based%20on%20the%20variable%20value%20%28for%20motabrasil%20at%20chandoo.org%29.xlsm


Regards!
 
SirJB7

I do apologize for the way I drove my first post.

I will follow the guidelines next time as recommended.


The solution proposed seems to work (I have several lines on my report)

I need to figure out how to install those formulas for my need.

However, I will search first from the posting history, if I have another

solution.


Thanks for the feedback.
 
Hi, motabrasil!

Glad you solved it. Thanks for your feedback and for your kind words too. And welcome back whenever needed or wanted. Just advise if any further help needed for integration, helper cells can be moved to an auxiliary worksheet so as to keep clean the data worksheet.

Regards!

PS: No need any apologize, it was just fyi.

PS2: No intention of offense with the sample data! :)
 
Back
Top