Need Help on Macro in Excel 2010

AnilS

New Member
Joined
Dec 4, 2013
Messages
8
Hi,

I have a set of data on a spreadsheet.
The Column "A" contains Serial Nos. 1 to 5000.
The Column "AT" contains the actual data and it extends upto 10 columns or so say till Columns "BC".
The data is upto several rows around 3000 rows. Each of these rows contain data from Column "AT" to Columns "BC". Each of these rows contain the first cell value in the multiples of 10 (like ex: 10, 20,30,40 60,90..etc).

What is required:
We know that the Column "A" has Sl Nos. from 1 to 5000, and if the cell "A25" has the SL No. as "30", then the actual data which is present in columns "AT" to "BC" should accordingly to move the respective row.

i.e. whichever the row has the matching number (30) in the column "AT", that entire set of data should move to the Row No. 25.

Let me know if anyone has a Macros for this.

- @NL
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Welcome to the Board!

I think you're going to need to be a bit more concise. It would help if you post a shot of what you've got now (see the HTML Maker link in my sig).
 
Upvote 0
Unfortunately, I can't access filesharing sites, so maybe someone else will be able to pitch in. If you can post some screen shots it would be better.
 
Upvote 0
Smitty,

Heres a basic idea of what his picture looks like.

a
b
c
d
e
f
g
h
1
10
2
20
3
30
30
data
data
data
data
4
40
40
data
data
data
data
5
50
6
60
7
70
50
data
data
data
data
8
80
10
data
data
data
data

<tbody>
</tbody>

The idea being that he wants the data in d1:h8 to sort itself by rows based on the data in a1:a8. So d3 matches a3..d4 a4..etc.. d7 should sort up to d5 and d8 should sort up to d1.

So my first idea is if you had the base data in another sheet or a data base you could display it here using something with an Hlookup. Essentially Hlook up in say d1, e1, f1, g1, h1. It would access the data table on the other sheet and then display whatever was in the a row. This would mean you would have to copy the code down for all the lines but would allow you the ability to instantly change anything in a1

Past that you could use something like this..http://excelexperts.com/sorting-custom-sort-order-vba..only problem here is that the sort stops working if you have blanks and does not up the information into the same row.
 
Upvote 0
Smitty,

Heres a basic idea of what his picture looks like.

abcdefgh
110
220
33030datadatadatadata
44040datadatadatadata
550
660
77050datadatadatadata
88010data datadatadata

<tbody>
</tbody>

The idea being that he wants the data in d1:h8 to sort itself by rows based on the data in a1:a8. So d3 matches a3..d4 a4..etc.. d7 should sort up to d5 and d8 should sort up to d1.

So my first idea is if you had the base data in another sheet or a data base you could display it here using something with an Hlookup. Essentially Hlook up in say d1, e1, f1, g1, h1. It would access the data table on the other sheet and then display whatever was in the a row. This would mean you would have to copy the code down for all the lines but would allow you the ability to instantly change anything in a1

Past that you could use something like this..http://excelexperts.com/sorting-custom-sort-order-vba..only problem here is that the sort stops working if you have blanks and does not up the information into the same row.

Hi Shorn,

Thanks for the reply.

Just would like to mention that all the data will be available in the same sheet and also there would be no spaces in the middle as given in the pic.


Please let me know if you have a code or so for the same.

-@NL
 
Upvote 0
I'm not suite sure how you would approach this. Cutting/Pasting would seem logical, however you also have to take into account if a row already has existing data in it that doesn't belong and move that.

Unfortunately the data setup doesn't make much sense to me, but if I have some time this afternoon I'll see what I can do.
 
Upvote 0
I'm not suite sure how you would approach this. Cutting/Pasting would seem logical, however you also have to take into account if a row already has existing data in it that doesn't belong and move that.

Unfortunately the data setup doesn't make much sense to me, but if I have some time this afternoon I'll see what I can do.

Sure Smitty,

Will wait for your ideas.

- @NL
 
Upvote 0
one way,

sort column A in ascending order

sort columns D:H in ascending order on column D

first row in D:H, if A <> D then insert blank cells above D:H until A=D

go down one row in D:H and repeat
 
Upvote 0

Forum statistics

Threads
1,217,383
Messages
6,136,267
Members
450,001
Latest member
KWeekley08

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