Problem sorting

ikkuh

New Member
Joined
Apr 4, 2013
Messages
2
Hi,

I made a sort button with a macro to sort collum 1 and a button to sort collum 2.
Now in collum 1 are name and in collum 2 is the line (this is just a letter).
So these 2 collums acctually belong together.
I want to sort on name A->Z with 1 button but the "letter" in the other collum needs to stay with the samen name.
I also want to sort the "letters" A->Z and then tht names need to stay to the letters they belong to.

Is there a way to do this?


Thanks in advantage!

Grtz!
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Use only 1 macro & button and when "recording" the macro, select both columns 1 and 2, then your primary sort is on col 1 and secondary sort is on col 2.
 
Upvote 0
Hi,

I tryed that.
But I have some problems:
1)In the original file I merged some cell to make it look good (B-H) = collum 1 and (I-J) is collum 2 so it says that the cells don't have the same amount of cells.
2)I made them same size and tryed it the name still doesn't stay with de letter =/

Any id's what I do wrong in problem 2?
or maybe how I can fix problem 1?

thanks for your time!

Greetz ikkuh
 
Upvote 0
Open the Macro window (Developer-Macro): Here are a couple things to check:
1. Make sure you have only 1 macro. If you have 2 or more, you may have the wrong macro assigned to the button.
2. Click "Edit" and look at the macro code. Make sure it is selecting only D:D (or to exclude your merged cell, maybe D2:D10000). If you're not sure, please post the macro here.
 
Upvote 0

Forum statistics

Threads
1,203,538
Messages
6,055,992
Members
444,839
Latest member
laurajames

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top