I am working on a large macro that is currently working fine with a few spots that have a 'hardwired' range (such as A1:C1000). I originally 'hard-wired' the ranges just to get the macro working for BETA use. I am going back and trying to remove the specific ranges so the macro can find the correct volume of data and the size won't matter. Some of the areas I have changed are working fine, but I am having trouble getting other changes to work.

For example I have changed
Sheets("PLOT DATA").Activate
    Range("A2:O1000") = ""
to
With Sheets("PLOT DATA")
        Set clearstart = .Range(.Range("A2"), .Range("A2").End(xlDown))
        Set clearend = clearstart.Offset(, 14)
        Range(clearstart, clearend) = ""
    End With
, which works fine.

My plot uses
Dim rChartXData As Range
    Dim rChartYData As Range
    Worksheets("PLOT Data").Cells(6, 1).Select                          'select a single cell as the initial plot data

    
    On Error Resume Next                                                ' remove existing chart if exists
    Application.DisplayAlerts = False
    ActiveWorkbook.Charts("GRAPH By System").delete
    Application.DisplayAlerts = True
    On Error GoTo 0

    
    With ActiveSheet                                                    ' determine chart data ranges using only actual data
        Set rChartXData = .Range(.Range("G2"), .Range("G2").End(xlDown))
        Set rChartYData = rChartXData.Offset(, 1)
    End With

    
    With ActiveSheet.Shapes.AddChart.Chart                              'create new chart in PLOT DATA
        .ChartArea.ClearContents                                        'clear any existing chart contents
        
        With .SeriesCollection.NewSeries                                'add the new series of selected data
         m = Sheets("REPORT").Cells(2, "I")
         yr = Sheets("REPORT").Cells(2, "J")
         .Name = m & " " & yr
            .Values = rChartYData
            .XValues = rChartXData
        End With
which also works.
Selecting my print area also works (I found that function on the forum)
With Sheets("TEST1")
    .PageSetup.PrintArea = "$D$1:$M$" & _
        .Range("A:A").Find("*", .Range("A1"), xlValues, xlWhole, xlByRows, xlPrevious).Row
End With
Sheets("TEST1").PrintOut
    
'Print out Unit 2 CR list
With Sheets("TEST2")
    .PageSetup.PrintArea = "$D$1:$M$" & _
        .Range("A:A").Find("*", .Range("A1"), xlValues, xlWhole, xlByRows, xlPrevious).Row
End With
    Sheets("TEST2").PrintOut
also works.
The part that doesn't work: Before the plot section, I have to sort some data. My sort works with the specific range, but I can't get a dynamic range to work. The sort I am trying to use the dynamic range in is:
 Worksheets("SORT DATA").Activate                                'select the SORT DATA information
    Columns("A:G").Select                                           'Remove un-needed columns (leave sys/cat/SL)
    Application.CutCopyMode = False
    Selection.delete Shift:=xlToLeft
    Columns("D:F").Select
    Selection.delete Shift:=xlToLeft
    
    Columns("A:C").Select                                            'sorts data by system, then sub-cat, then SL
 
     ActiveWorkbook.Worksheets("SORT DATA").sort.SortFields.Clear
     ActiveWorkbook.Worksheets("SORT DATA").sort.SortFields.Add Key:=Range( _
         "A2:A1000"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
         xlSortNormal
     ActiveWorkbook.Worksheets("SORT DATA").sort.SortFields.Add Key:=Range( _
         "B2:B1000"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
         xlSortNormal
     ActiveWorkbook.Worksheets("SORT DATA").sort.SortFields.Add Key:=Range( _
         "C2:C1000"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
         xlSortNormal
 
     With ActiveWorkbook.Worksheets("SORT DATA").sort
        .SetRange Range("A1:C1000")
        .Header = xlYes
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With
I've tried different versions of the methods used in other sections fo the macro in this last section, but to no avail. The most recent attempt
With Sheets("SORT DATA")
        Set sortstart = .Range(.Range("A2"), .Range("A2").End(xlDown))
        Set sortend = sortstart.Offset(, 2)
'        Range(sortstart, sortend) = ""
    .SetRange Range(sortstart, sortend)
End With
    
Worksheets("SORT DATA").Activate                                'select the SORT DATA information
    
    Columns("A:G").Select                                           'Remove un-needed columns (leave sys/cat/SL)
    Application.CutCopyMode = False
    Selection.delete Shift:=xlToLeft
    Columns("D:F").Select
    Selection.delete Shift:=xlToLeft
    
    Columns("A:C").Select                                            'sorts data by system, then sub-cat, then SL
 
     ActiveWorkbook.Worksheets("SORT DATA").sort.SortFields.Clear
     ActiveWorkbook.Worksheets("SORT DATA").sort.SortFields.Add Key:=Range( _
         "A:A"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
         xlSortNormal
     ActiveWorkbook.Worksheets("SORT DATA").sort.SortFields.Add Key:=Range( _
         "B:B"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
         xlSortNormal
     ActiveWorkbook.Worksheets("SORT DATA").sort.SortFields.Add Key:=Range( _
         "C:C"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
         xlSortNormal
 
     With ActiveWorkbook.Worksheets("SORT DATA").sort
        .SetRange Range("A1:C1000")
        .Header = xlYes
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With
(above) fails at
.SetRange Range(sortstart, sortend)
I've been working on this off and on for over two weeks and it is time to ask for help. Please help...

The last time I tried to upload a file, I couldn't, FYI in case you were wondering.