hendrikbez
Board Regular
- Joined
- Dec 13, 2013
- Messages
- 95
- Office Version
- 2021
- Platform
- Windows
I have this as a micro
But the problem is that every day the row can be more or less that what I have got here, how can I make it so that it will now at what row to stop
With a macro of vb.
Code:
Sub sort1()
'
' sort1 Macro
'
'
Range("A4:F18").Select
ActiveWorkbook.Worksheets("All").sort.SortFields.Clear
ActiveWorkbook.Worksheets("All").sort.SortFields.Add Key:=Range("F4:F18"), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
ActiveWorkbook.Worksheets("All").sort.SortFields.Add Key:=Range("A4:A18"), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("All").sort
.SetRange Range("A4:F18")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
But the problem is that every day the row can be more or less that what I have got here, how can I make it so that it will now at what row to stop
With a macro of vb.