MrTreasury
New Member
- Joined
- May 17, 2019
- Messages
- 11
Hello forum,
I hope you're all well.
I'm in need of help as I've just not been able to figure this out. I'm looking to sort a table out through a macro.
The table's range is B2:F30, where B2 is the table's headers. Column F contains the dates I require sorting.
I did record a macro and attempt to adapt it and copy it into the main piece of code I'm writing but seem to get numerous errors whenever I tweak it.
I had initially tried:
I use range B3:F30 purely as I just wanted the code to work on the area I wanted rather than the table itself hence the ranges and header being contrary to the start of my post.
Anyone have any tips/pointers or solutions?
Kind regards,
MrT
I hope you're all well.
I'm in need of help as I've just not been able to figure this out. I'm looking to sort a table out through a macro.
The table's range is B2:F30, where B2 is the table's headers. Column F contains the dates I require sorting.
I did record a macro and attempt to adapt it and copy it into the main piece of code I'm writing but seem to get numerous errors whenever I tweak it.
I had initially tried:
Code:
ws.Range("B3:F30").Sort key1:=Range("F3"), Order1:=xlAscending, Header:=xlNo, DataOption1:=xlSortNormal
I use range B3:F30 purely as I just wanted the code to work on the area I wanted rather than the table itself hence the ranges and header being contrary to the start of my post.
Anyone have any tips/pointers or solutions?
Kind regards,
MrT