MistakesWereMade
Board Regular
- Joined
- May 22, 2019
- Messages
- 103
So I have a command button that when clicked, I would like to sort a cell range in a worksheet.
For some reason, my cells are not sorting using my code below. Any suggestions?
For some reason, my cells are not sorting using my code below. Any suggestions?
Code:
Sheets("Formula Data").Range("I2").Value = rowNum1
Sheets("Formula Data").Range("I3").Value = rowNum2
Sheets("Formula Data").Range("I4").Value = rowNum3
Sheets("Formula Data").Range("I5").Value = rowNum4
Sheets("Formula Data").Range("I6").Value = rowNum5
Application.EnableEvents = False
For u = 1 To 1
On Error Resume Next
Sheets("Formula Data").Range("I1:I6").Sort Key1:=Range("I1"), Order1:=xlAscending, Header:=xlYes
Next u
Application.EnableEvents = True