I have a very simple spreadsheet using Excel 2002 SP3. I am using a script I found on this site and a button to sort data by a particular field. I don't have much knowledge of VB. Heres the script:
Private Sub Worksheet_Activate()
On Error Resume Next
Application.EnableEvents = False
Me.UsedRange.Sort _
Key1:=[A1], Order1:=xlAscending, header:=xlYes, Orientation:=xlSortColumns
Application.EnableEvents = True
On Error GoTo 0
End Sub
Basically, everything works ok but the script, it puts the data on top of the header, which occupies row 2. The data starts in row 3 while row 1 contains the worksheet name. Please help!
Ek
Private Sub Worksheet_Activate()
On Error Resume Next
Application.EnableEvents = False
Me.UsedRange.Sort _
Key1:=[A1], Order1:=xlAscending, header:=xlYes, Orientation:=xlSortColumns
Application.EnableEvents = True
On Error GoTo 0
End Sub
Basically, everything works ok but the script, it puts the data on top of the header, which occupies row 2. The data starts in row 3 while row 1 contains the worksheet name. Please help!
Ek