How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask The-PC-Guy Your Own Question

The-PC-Guy
The-PC-Guy, Software Engineer
Category: Programming
Satisfied Customers: 1895
Experience:  Extensive Knowledge in PHP, MYSQL, CSS & Javascript
62934938
Type Your Programming Question Here...
The-PC-Guy is online now
A new question is answered every 9 seconds

I have a macro that creates a pivot table, sort column on

Customer Question

Hi,
I have a macro that creates a pivot table, sort column B on sheet 1 and once column B is sorted in descending order pastes the value in column A to another sheet in column B of that new sheet. I'd like to run it from column B to the end of the worksheet and I am not sure how to do that.
Example
Sheet 1:
Column A Column B Column C
Apple 5 8
Oranges 10 9
Bananas 7 7
What I would like the result to be:
Sheet 2
Column A Column B Column C
Rank
1 Oranges Oranges
2 Bananas Apples
3 Apple Banana
How should I approach something like that? My knowledge of VBA is very low, I mostly record macro and sometimes edit them minimally.
Thanks,
Submitted: 8 months ago.
Category: Programming
Expert:  Jason Jones replied 8 months ago.

Hello,

I am the person that will be helping you today. May I ask for a copy of the document or an example of one?

Please, be forewarned that the site is not secure:
- Click the following link: http://www.wikisend.com
- Upload the file to that website
- Once it is uploaded, the resulting page will display a "File ID" number.
- Please, give me that "File ID Number"
I will be standing by, looking forward to your response.

Thank you,
Jason

Customer: replied 8 months ago.
do you have an email instead? I'm on my phone
Expert:  Jason Jones replied 8 months ago.

You may send it to***@******.*** and ask them to send it to me, ***** *****. My screen name is: ComputerTechMaster

Customer: replied 8 months ago.
done
Expert:  Jason Jones replied 8 months ago.

Thank you. It may take a while for them to forward it to me. I will be standing by.

Customer: replied 8 months ago.
No worries, I have time. As you write code, it would be great if you can write comments on what the code is doing so I can follow it. Thank you
Expert:  Jason Jones replied 8 months ago.

Thank you

Expert:  Jason Jones replied 8 months ago.

I received the file and have attached it here.

I will not be able to help.

For this reason, I am opting out of the question and allowing another expert the chance to help.

The next expert will see all that is on this page, so there will be no need to repeat anything.

When another expert picks this up, you will be notified by email.

Thank you for your patience.

- Jason

Expert:  The-PC-Guy replied 8 months ago.

are you still looking for help with this?

Customer: replied 8 months ago.
Expert:  The-PC-Guy replied 8 months ago.

i would need to see an example file before I could quote a price.

Customer: replied 8 months ago.
It's attached in the above conversation
Expert:  The-PC-Guy replied 8 months ago.

sorry I never saw a file attached. Can you send again?

Customer: replied 8 months ago.
Sure, here it is
Expert:  The-PC-Guy replied 8 months ago.

I will take a look and get back as soon as possible can you provide a better description of what you want to do, if possible refer to column letters rows or cells

Customer: replied 8 months ago.
Sure,I have a macro that creates a pivot table, I included the text there, sort column B on sheet 1 and once column B is sorted in descending order pastes the value in column A to another sheet in column B of that new sheet. I'd like to run it from column B to the end of the worksheet and I am not sure how to do that. the part I am missing is basically the loop part.The sheet I included has a tab with the data and a tab with the sample answerExampleSheet 1:
Column A Column B Column C
Apple 5 8
Oranges 10 9
Bananas 7 7What I would like the result to be:Sheet 2
Column A Column B Column C
Rank
1 Oranges Oranges
2 Bananas Apples
3 Apple BananaHow should I approach something like that? My knowledge of VBA is very low, I mostly record macro and sometimes edit them minimally.Thanks,
Expert:  The-PC-Guy replied 8 months ago.

well your not really using a pivot table. But basically you are looking to take the first sheet, and sort highest to lowest value, then copy the values in column A to column B and repeat the process through all the columns?

Customer: replied 8 months ago.
you are right, I meant filter not pivots to filter descending order and remove the ones worth zero values
Expert:  The-PC-Guy replied 8 months ago.

you are throwing another wrench in the machine now. Can you explain what you mean by remove ones with 0 values. Wouldn't a descending sort put those at the very end anyway?

Customer: replied 8 months ago.
but on the side, I don't want to copy the label cherry if there are zero so the way I manually do it is that I add the filter, sort descending and un select zero values and that way only the rows with non zero values are left
Expert:  The-PC-Guy replied 8 months ago.

so if a column has only 1 or 2 of the values that don't get a zero only those values would be copied to the other sheet?

Do I have a complete understanding of what you are trying to accomplish now?

Customer: replied 8 months ago.
Only the labels in column A corresponding to these values would be copies yes
Expert:  The-PC-Guy replied 8 months ago.

ok got it.

I can certainly create this program, but it is a bit complicated and will take some time.

For this reason I have to increase the price a bit. I am sending you an additoinal service offer, please accept it and I will get started.

Remember I am just a consultant, and I do not control the billing of this site, but the way I understand it is that the additional amount is added to the question cost, so you pay for both.

I think this is fair given the amount of work involved and the price originally selected.

Customer: replied 8 months ago.
No I think I'm not interested then, I'll do it manually but thanks for your help
Expert:  The-PC-Guy replied 8 months ago.

ok as you wish, if you change your mind you know where to find me