sorton=xlsortonvalues

  1. R

    custom sort not applying

    I've recorded a custom sort. The sort works exactly how I want, when manually applied (during record process), but fails to apply when applied by executing recorded vba code; by fail, I mean not applying sort and no error messages displayed. After the code has completed, I can visit the "Custom...
  2. E

    Change range in a sort macro

    Hi all, I am working on this sheet and I need a lot of data to be sorted in a specific manner. The only issue is that the data I use changes. One week I may have 5000 rows of data in Excel, and others I may have 6000. Is there a way to make the sorta range in this code here change based on how...
  3. T

    Add Sort Function To A Varying Length Spreadsheet

    Hi all, I am trying to add a sort function to a spreadsheet that varies in length, however the code stops when it gets to the .Apply section, does anyone know how to fix this? See the code below: LastRow = sht.Range("A1").CurrentRegion.Rows.Countsht.Range("A2", sht.Range("k" & LastRow)).Select...
  4. P

    Sorting multiple sheets with variable rows

    Hi All, The following code has some issues.it is working when all rows are same but whenever it needs to sort a sheet with variable rows , it is selecting the cells but not sorting. Pls Help. Sub Sort() Dim i As Long Dim LastARow As Integer LastARow =...
  5. S

    VBA sort by two columns and add row after first sort based on cell

    I have the below code to sort my data by color (K11:K123) and by item (C11:C123). Is there a way to have a blank row inserted (also have all formulas of all other cells) to separate when the color changes. Range("B11:M123").Select ActiveWindow.SmallScroll Down:=-102...
  6. C

    excel vba on change events for sorting if changed from......

    So I have the below code which works perfectly (maybe could be cleaned up a little but its working) what im trying to figure out if right now if column I changed then it runs the sort or if "ETOX-SKIP" is selected from the drop down in column D then it sorts. The thing im trying to figure out...
  7. Z

    Dynamic Range

    Hi, I have a table that it's macro driven. What I need is to sort this table based on criteria and I have recorded below macro to do that, however, the range is dynamic and it depends on number employees that are reporting to each manager. What I need is how to write a macro that can sort...
  8. I

    Range Error in sort - Range of Object _Global failed

    So I used this code to find the last column letter... With ActiveWorkbook.Worksheets("Edit Here") LastCol = .Cells(4, .Columns.Count).End(xlToLeft).Column End With ColumnLetter = Split(Cells(1, LastCol).Address, "$")(1) And then when I tried to sort, using that in a range, I get an...
  9. D

    clenaner code to sort

    hi guys used the recorder for this finalrow = Cells(Rows.Count, "A").End(xlUp).Row ActiveWorkbook.Worksheets("Domestic NI").Sort.SortFields.Clear ActiveWorkbook.Worksheets("Domestic NI").Sort.SortFields.Add Key:=Range( _ "A10:A" & finalrow), SortOn:=xlSortOnValues...
  10. Dazzawm

    Help With Monotonous Sort Code

    I have to sort many thousand rows by selection but each time I select the rows i want to sort the sort criteria keeps resetting itself. I done a recorded macro but obviously the range of rows change each time. What needs changing in code for the sort to work on my selected rows each time...
  11. L

    Sorting in Excel from Access

    Hello Having tried unsuccessfully to find a solution to the below issue on both google and old threads in this forum I kindly request any suggestions as to how to solve this problem. I'm simply trying to sort a range in an Excel file from Access, but it's erroring with everything I try. My...
  12. H

    Sorting macro

    The problem here is I am poor at creating sorting macros, and use the recorder, and tried to implement a variable for the bottom row. This is an easy fix, right? I am getting error for this, "doesn't support this property or method". The first error is in Bold below. B_Row is defined just...
  13. F

    Macro edit - tab character limit

    Good morning, I have a macro that organizes data and then splits that data into different tabs based on a name in column AC. The issue I just ran into was when the name was too long for a tab (character limit I believe is 30). Is there a way to update this macro to either read only to the 30th...
  14. K

    Excel VBA sort sometimes stops (but doesn't error)

    This one has been driving me nuts for some time so I'm hoping one of the knowledgeable people here has an answer. I have a massive spreadsheet (11 MB and growing) that I use to track stock trading data. Imbedded w/i the spreadsheet are many RTD functions calling ToS to get real time data on...
  15. S

    Loop recorded macro through all worksheets

    Hi, I am trying to loop a one worksheet (name of that worksheet was Booking)recorded macro through all the sheets in the workbook. The recording was to sort data within a range alphabetically. No security issues I am aware of. If anyone could amened the following code to this, that'd be...
  16. S

    Sorting multiple range but error

    hi below is my macro.. with error reference is not valid. i went though the web but can't find answer that satisfy me. Please help Range("A8:Q500").Select ActiveWorkbook.Worksheets("NAVAnalysisChk").QueryTables(1).Sort.SortFields. _ Clear...
  17. A

    help with refining a recorded macro

    Hi All, I've recorded a macro that sorts about 19 tables (used to create charts). I was wondering if there is a more efficient way to write this code? And if someone could have a crack at it? Sub SortZoneCharts() ' ' SortZoneCharts Macro ' ' Sheets("Chart_Tables").Select...
  18. T

    Sort by Active Table, Help.

    Please help. I cannot get this macro to work.... I am trying to sort by the active table, criteria is column 1. Then I would like to add a second critera, column 5 of the table. I keep getting an error on the line... ".Sort.SortFields.Add Key:=Range([activeTable("Column1")])...
  19. D

    Desire to make VBA code more efficient

    I'm a beginner working with VBA. I first used the "record a new macro" function in Excel to create my first set of Macro's. I progressed to the point of looking for snippets of code on the internet to accomplish specific tasks that needed to be done. However, I am very aware that my coding is...
  20. S

    Looping through all worksheets

    My code is supposed to loop through all worksheets and perform the formula and sorts on each worksheet in the workbook. It performs the first task of inserting a line on all sheets but it does not finish the rest of the code on the rest of the worksheets. I've made the first line that is...

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