Sort and Merge Groups In Table Excel VBA Macro

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ธ.ค. 2024

ความคิดเห็น • 9

  • @lordasa619
    @lordasa619 ปีที่แล้ว +1

    Perfect! This deserved more views.

  • @szewing9038
    @szewing9038 2 ปีที่แล้ว +1

    Nice Video!

  • @marcosbail6090
    @marcosbail6090 2 ปีที่แล้ว +1

    Ótimo.... Muito bom....

    • @souzamotasacul
      @souzamotasacul 2 ปีที่แล้ว +1

      1 Brasileiro por aqui! That’s cool

  • @VijaySingh-sm5vo
    @VijaySingh-sm5vo ปีที่แล้ว

    thank you very much. it helped a lot. Can you design a code to move priority countries (taking example from your sheet) at top

    • @ExcelMacroMania
      @ExcelMacroMania  ปีที่แล้ว +1

      You need to have a priority list in the form of an array and then put it into an automatic list as input in a custom sorting (alternatively, get the values in a range as priority list or write them directly as comma delimited). Let's say you want to sort by country size Germany, France, Italy,... would be like this:
      Dim PrioList As Variant
      PrioList = Array("Germany", "France", "Italy", "Spain", "Poland")
      Application.AddCustomList ListArray:=PrioList
      Range("A1").CurrentRegion.Sort Key1:=Range("A1"), Order1:=xlAscending, _
      Header:=xlYes, OrderCustom:=Application.CustomListCount + 1
      Application.DeleteCustomList Application.CustomListCount

    • @VijaySingh-sm5vo
      @VijaySingh-sm5vo ปีที่แล้ว

      thanks, but showing run time error 1004, all merged cell need to be the same size@@ExcelMacroMania

    • @ExcelMacroMania
      @ExcelMacroMania  ปีที่แล้ว +1

      @@VijaySingh-sm5vo You need to use that code before merging the cells, with the original table, just like in the video, first sort, then merge. Good luck!

    • @VijaySingh-sm5vo
      @VijaySingh-sm5vo ปีที่แล้ว +1

      thank you i will try @@ExcelMacroMania