• 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 paste based on cell value

Krix

New Member
Hi, I am new here and was hoping if someone can help me me make the macro for the block movement that I am working on.
If you open the spreadsheet attached you'll see this:

Column A is the letters
Column B is where the campaign will be printed
Column E is the campaign
Column F is where the campaign should go

What it should do first is that it will get the unique letters and the count it from column A, as an example is in Column I to K, once it found the unique letter, count of it and where is the row number of it. It will now print the Campaign in column B with the same times that is indicated in Column G.

I have did an example already in Column B, in this scenario Campaign 4 needs to be printed 5 times in letter A, that's why he was prioritized and was printed in 5 A's.

Thank you so much in advance.
 

Attachments

  • time computation (2).xlsx
    10 KB · Views: 4
Something like this?
Press the button!
btw Campaign 3 don't have a place ...
 

Attachments

  • time computation.xlsm
    23.5 KB · Views: 1
This is awesome! Thank you so much, with regards to campaign 3. What I wanted to happen is after adding those 'priorities' (which are the ones that has exact value) I wanted to put that campaign 3 in other A's even though it's not the exact value and this condition is on the last thing that the macro will do. Is that possible?
 
Hmm ... many things are possible, but ... but ... and ...
I changed the code little ... better.
Now, G-col values don't have to be exact ... J-col value can be even or smaller :)
But, now there comes 'no place' for Campaign 2 :(
because now, Campaign 1 take 1st possible place (21*A needs 19*A) and after that there isn't enough big area for Campaign 2. Of course ... not good idea ... if could use a little another letters area, there could be enough area, but after that, there would be more more problems. So, it's better to mark enough large areas for every Campaign ... I hope that You got idea of my answer.
 

Attachments

  • time computation.xlsm
    43.2 KB · Views: 0
Here is a new version for testing on 'Sheet2'.
It tries to find the smallest possible place ...
but there are still not enough marked places.
Someway, this 'Sheet2'-version is anyway better ... safer ... economy ...
 

Attachments

  • time computation.xlsm
    68.4 KB · Views: 1
Back
Top