Ok, so I have a workbook with 4 sheets, on one sheet I want to have a button that will sort data on a differing sheet.
I wrote some VBA code and it didn't work, so I went back to basics and used the macro record and the code were virtually like for like, I took the code from the recorded macro and put it into the VBA code for my button but it still kicks up a fuss.
Can anyone point me in the right direction
This is the code from the macro, my orginal code was identical apart from the the 'ActiveWindow.SmallScroll Down......'
When it comes to the debug it highlights:
Help please!!
I wrote some VBA code and it didn't work, so I went back to basics and used the macro record and the code were virtually like for like, I took the code from the recorded macro and put it into the VBA code for my button but it still kicks up a fuss.
Can anyone point me in the right direction
Code:
Private Sub CommandButton1_Click()
Sheets("Team DB").Select
ActiveWindow.SmallScroll Down:=-64
Range("A3:D94").Select
Selection.Sort Key1:=Range("D3"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End Sub
This is the code from the macro, my orginal code was identical apart from the the 'ActiveWindow.SmallScroll Down......'
When it comes to the debug it highlights:
Range("A3:94").Select
Help please!!