tonywatsonhelp
Well-known Member
- Joined
- Feb 24, 2014
- Messages
- 3,147
- Office Version
-
- 365
- 2019
- 2016
- Platform
-
- Windows
Hi everyone,
I tried his is my macro
writing the data sort macro but it doesn't work,
what I'm trying to do is make it easy for me to go in and edit the cell range and the sort column as I have a lot of these to right, so I thought id do it by seting the column it sorts by and the cell range at the top and using the words as the ranges in the code, belive me when I tell you this is needed!!!
the problem is it doesn't work? can someone please fix it or tell me what I did wrong?
this is my macro:
so for the moment all I want is a macro that sorts range H4:L7 by column I in Assending order.
please help
thanks
Tony
I tried his is my macro
writing the data sort macro but it doesn't work,
what I'm trying to do is make it easy for me to go in and edit the cell range and the sort column as I have a lot of these to right, so I thought id do it by seting the column it sorts by and the cell range at the top and using the words as the ranges in the code, belive me when I tell you this is needed!!!
the problem is it doesn't work? can someone please fix it or tell me what I did wrong?
this is my macro:
Code:
End Sub
Sub Macro6()
'
Dim oneRange As Range
Dim aCell As Range
Set oneRange = Range("H4:L7")
Set aCell = Range("I4:I7")
bCell = "xlAscending"
oneRange.Sort Key1:=aCell, Order1:=bCell, Header:=xlGuess
End Sub
so for the moment all I want is a macro that sorts range H4:L7 by column I in Assending order.
please help
thanks
Tony