VBA to Sort Data in Excel - Excel VBA Tutorial

Поделиться
HTML-код
  • Опубликовано: 10 окт 2024
  • This example explains simple vba code for data sorting. VBA Macro to sort data in descending order and ascending order with easy example.

Комментарии • 43

  • @itdoeshurt
    @itdoeshurt 5 лет назад +2

    3 rascal fiverrrs couldnt do this simple trick for me,
    u saved a life today, thank u and bless u...

  • @derryckklarkowski2269
    @derryckklarkowski2269 3 года назад +2

    Thank you. I searched many sites with no success. This video gave me the information I needed in a beautifully simple and clear manner. Worked perfectly. Much appreciated!

  • @ralphallengamboa9394
    @ralphallengamboa9394 3 года назад +1

    Its my first time to know about the Developer Tab, thank you for video Tutorial, you nailed what I came for.

  • @ajigrafi
    @ajigrafi 4 года назад +5

    For anyone who want to run Macro without any button, this the code:
    Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    Dim total_data As Range
    Dim specific_column As Range
    Set total_data = Worksheets("Sheet1").Range("A:L")
    Set specific_column = Worksheets("Sheet1").Range("J:J")
    total_data.Sort Key1:=specific_column, Order1:=xlAscending, Header:=xlYes
    Worksheets("Sheet1").Cells(1, 1).Select
    End Sub

    • @Akashpadhan
      @Akashpadhan 9 месяцев назад

      Exactly what i want

    • @romcasimiro9668
      @romcasimiro9668 Месяц назад

      Thanks bro but I have a question, whenever i try to enter another text such as pressing enter to go to the next cell it keeps coming back on A1 cell.

  • @rbrtsparkman
    @rbrtsparkman 4 года назад +1

    Thanks for this video. I'm subscribing because it is literally perfect.

  • @1gopalakrishnarao
    @1gopalakrishnarao 6 лет назад

    Thank you. Very helpful. Please publish some more for the VBA learners/users/addicts/lovers.

    • @ExcelDestination
      @ExcelDestination  6 лет назад +2

      Thanks Gopala for your appreciation...let me know...if you are looking for tutorial on any specific topic in vba...I will try...till then keep watching...and please share it further...

  • @arnoldremulta8939
    @arnoldremulta8939 Год назад +1

    Thank you....

  • @kanemac1443
    @kanemac1443 Год назад

    Thank you sir !

  • @ajigrafi
    @ajigrafi 4 года назад +1

    Thank you so much, it's work perfectly.

  • @alpisuanto6536
    @alpisuanto6536 5 лет назад +1

    Thank you for the instructions.

  • @MOLOKOmilk
    @MOLOKOmilk 5 лет назад +1

    Thanks! Very helped me.

  • @sharadmoktan6874
    @sharadmoktan6874 4 года назад +2

    What is the VBA code to high light the list box data based on conditions

  • @shubalubla
    @shubalubla 5 лет назад +1

    thank you very much for the video!

  • @stevennye5075
    @stevennye5075 5 лет назад +1

    very useful

  • @brightcomputers9326
    @brightcomputers9326 5 лет назад +1

    Sir it is a very nice but i am just curious that whether it is implement in automatic process to sort the data? If yes then please give the process

  • @bongdelicacy3158
    @bongdelicacy3158 3 года назад

    Thanks for this tutorial. Can u pls explain if sort to be oldest to newest then what should be the code?

  • @archanaaa2514
    @archanaaa2514 4 года назад +3

    Sir, how to sort total data at a time ?

  • @murtadhasafir2053
    @murtadhasafir2053 5 лет назад +1

    I would like to know how to sort multiple columns in table format with a single click.

  • @MohAboAbdo
    @MohAboAbdo 5 лет назад

    Great video, thank you so much.

  • @PremKumar-de6gr
    @PremKumar-de6gr 4 года назад

    Thank u so much sir

  • @AniManuSCh
    @AniManuSCh 4 года назад

    How can be sorted when condition is met and toggle between ascending and descending? for example: when a header cell is selected or doble clicked then sort that column in an ascending way by default, but if it is already sorted that way, then sort it in descending way instead

  • @DeepGill-dl3wj
    @DeepGill-dl3wj 11 месяцев назад

    I am getting 'sort method of rante class failed ' error... Kindly advise

  • @alagurajan1787
    @alagurajan1787 4 года назад +1

    Hi. Please suggest. How to enhance this for all the worksheets in the workbook. Please help sir

    • @ExcelDestination
      @ExcelDestination  4 года назад

      you can loop through same code for all sheets. you can take help from following tutorial :
      ruclips.net/video/AlC8a7KyJq0/видео.html

  • @evanbarna8454
    @evanbarna8454 4 года назад +1

    I am not a saavy vet when it comes to VBA, this button is not working for me. It simply highlights cell A1,A1 when I click the button. What did I do wrong?

    • @evanbarna8454
      @evanbarna8454 4 года назад +1

      Figured out how it can sort but it's pull my data up that I am attempting to sort. How do I prevent this?

    • @ExcelDestination
      @ExcelDestination  4 года назад

      Without looking at code, can not say anything. you can share your code at exceldestination@gmail.com. I will try to check and respond.

  • @paulinavillalobosorozco9349
    @paulinavillalobosorozco9349 4 года назад +1

    i love you

  • @cfucharsadda8153
    @cfucharsadda8153 4 года назад +1

    Bundles of Thnx sir.

  • @belalmusallam
    @belalmusallam Год назад

    Can I used this code with date values??

  • @samnangsuonsokunth8719
    @samnangsuonsokunth8719 11 месяцев назад

    can you teach me how to find top 10 in vba code?

  • @dudeyme3331
    @dudeyme3331 5 лет назад +1

    👍

  • @Aaron2108_
    @Aaron2108_ 4 года назад +1

    How about Sort by Custom ?

  • @samnangsuonsokunth8719
    @samnangsuonsokunth8719 11 месяцев назад

    can teach me how to find top10?

  • @3ddance367
    @3ddance367 4 года назад +1

    Thanks
    If 2,2the same

  • @goyaltraders3265
    @goyaltraders3265 6 лет назад

    Please reply me

    • @ExcelDestination
      @ExcelDestination  6 лет назад

      what is your question...have you sent any question on exceldestination@gmail.com ?

    • @ExcelDestination
      @ExcelDestination  6 лет назад

      I say your comment....please send me your sample data at EXCELDESTINATION@GMAIL.COM, I will call you tomorrow...and will reply to your email also....thanks