Sortng data with rows of differnt heights. etc

Mabocat

Board Regular
Joined
Apr 20, 2011
Messages
74
I have a spreadsheet page made of 14 columns and on average 60 rows - some are standard height & others larger and is planned to be sorted on a time of hours & minutes based on one column.
Currently I cut and paste the rows because i had merged cells. After reformatting the cells, I now have a macro that sorts the data OK but the row formatting of height is ruined.

Is it possible to sort data ( meaning the rows) and maintain the row formatting ? if so, what do I do to change my macro
Code:
     With Worksheets("Tawnton")
       .Sort.SortFields.Clear
    .Sort.SortFields.Add Key:=Range("Tawnton_time"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
    With .Sort
      .SetRange Range("Tawnton_data")
      .Header = xlGuess
      .Orientation = xlTopToBottom
      .Apply

Ron

PS sorry for spelling errors in Subject - unable to edit it.
 
Last edited:
when I am in Edit mode & F8 to step thru macro and have screen show exactly what happens, I want to see all the actions of selecting the various ranges, have the Sort data input box show , etc and even with your code, to step row by row to test for the word "Set" and show the row height box being changed from the basic 16.25 to 30.
Stepping through via F8 will do all of that, but I don't know what you're expecting to see.
For example, you won't see any ranges selected unless the code actually selects the range.

I got your code working separately but the arrows don't move with the row, even though they are set to move with cells being in column L
I don't know what to tell you. There is no such problem with your downloaded workbook.
Make sure the arrows start off within the correct cell, and do not overlap other cells.
 
Upvote 0

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
All working now & I can see some of various ranges, etc but the arrows - no, no good so I will leave them out

thanks for your help.
 
Upvote 0
All working now & I can see some of various ranges, etc but the arrows - no, no good so I will leave them out

As an alternative, you could add some arrows to the text. For example :

' Set up MG1 Charde local goods upto maximum of 7 wagons - see Shunting Instruction #1 ◄◄◄

Each arrow is added with ALT+17
 
Last edited:
Upvote 0
Just to advise with a few tweaks in coding, all is going good , even managed to "correct" some other macros in the file.
Now to import all macros into 11 other similar files

So thanks footoo for your persistence with me.

Sometime this week, this book is arriving EXCEL VBA Programming for Dummies

Ron
 
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,525
Members
449,088
Latest member
RandomExceller01

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